pub struct Id(/* private fields */);
Expand description
Identifier of a channel.
This type can be created by calling Sender::id
or Receiver::id
and
be used to identify channels. It only use case is to compare two ids with
one another, if two id are the same the sender(s) and receiver(s) point to
the same channel.
§Notes
The id is only valid for the lifetime of the channel. Once the channel is dropped all ids of the channel are invalidated and might return incorrect results after.
The methods Sender::same_channel
and Sender::sends_to
should be
preferred over using this type as they are less error-prone.
Trait Implementations§
impl Copy for Id
impl Eq for Id
impl StructuralPartialEq for Id
Auto Trait Implementations§
impl Freeze for Id
impl RefUnwindSafe for Id
impl Send for Id
impl Sync for Id
impl Unpin for Id
impl UnwindSafe for Id
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