pub struct SenderId(/* private fields */);Expand description
The identifier a Discovery Server gives an advertised sender.
SendListener reports it and takes it back to subscribe to the
sender’s events.
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 SenderId
impl SenderId
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§
impl Eq for SenderId
Source§impl Ord for SenderId
impl Ord for SenderId
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 PartialOrd for SenderId
impl PartialOrd for SenderId
impl StructuralPartialEq for SenderId
Auto Trait Implementations§
impl Freeze for SenderId
impl RefUnwindSafe for SenderId
impl Send for SenderId
impl Sync for SenderId
impl Unpin for SenderId
impl UnsafeUnpin for SenderId
impl UnwindSafe for SenderId
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