pub struct ReceiverId(/* private fields */);Expand description
The identifier a Discovery Server gives an advertised receiver.
RecvListener reports it and takes it back to subscribe to the
receiver’s events and to ask the receiver to change source.
The identifier is opaque: no UUID spelling is assumed, and it keeps exactly the bytes the server supplied, so it always names the same peer even when those bytes are not valid UTF-8.
Implementations§
Source§impl ReceiverId
impl ReceiverId
Sourcepub fn new(value: impl Into<Vec<u8>>) -> Result<Self>
pub fn new(value: impl Into<Vec<u8>>) -> Result<Self>
Make an identifier from bytes obtained elsewhere, such as a saved selection.
§Errors
Returns Error::InvalidCString when the bytes contain a NUL.
Sourcepub fn to_string_lossy(&self) -> Cow<'_, str>
pub fn to_string_lossy(&self) -> Cow<'_, str>
The identifier as text for display, with any bytes that are not UTF-8 replaced by U+FFFD. Use the identifier itself, not this text, to name the peer again.
Trait Implementations§
Source§impl Clone for ReceiverId
impl Clone for ReceiverId
Source§impl Debug for ReceiverId
impl Debug for ReceiverId
Source§impl Display for ReceiverId
impl Display for ReceiverId
impl Eq for ReceiverId
Source§impl Hash for ReceiverId
impl Hash for ReceiverId
Source§impl Ord for ReceiverId
impl Ord for ReceiverId
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialEq for ReceiverId
impl PartialEq for ReceiverId
Source§impl PartialOrd for ReceiverId
impl PartialOrd for ReceiverId
impl StructuralPartialEq for ReceiverId
Auto Trait Implementations§
impl Freeze for ReceiverId
impl RefUnwindSafe for ReceiverId
impl Send for ReceiverId
impl Sync for ReceiverId
impl Unpin for ReceiverId
impl UnsafeUnpin for ReceiverId
impl UnwindSafe for ReceiverId
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more