pub struct UnboundedSender<T> { /* private fields */ }Expand description
The sending half of an unbounded MPSC channel
Implementations§
Source§impl<T> UnboundedSender<T>
impl<T> UnboundedSender<T>
Sourcepub fn send(&self, value: T) -> Result<(), SendError<T>>
pub fn send(&self, value: T) -> Result<(), SendError<T>>
Sends a value on this channel
This method never blocks. It will return an error if the receiver has been dropped.
Sourcepub fn id(&self) -> usize
pub fn id(&self) -> usize
Returns a unique identifier for this channel based on the shared pointer address
Sourcepub fn same_channel(&self, other: &Self) -> bool
pub fn same_channel(&self, other: &Self) -> bool
Returns true if this sender and another sender send to the same channel
Sourcepub fn downgrade(&self) -> WeakUnboundedSender<T>
pub fn downgrade(&self) -> WeakUnboundedSender<T>
Converts the UnboundedSender to a WeakUnboundedSender that does not count
towards RAII semantics, i.e. if all UnboundedSender instances of the
channel were dropped and only WeakUnboundedSender instances remain,
the channel is closed.
Sourcepub fn strong_count(&self) -> usize
pub fn strong_count(&self) -> usize
Returns the number of UnboundedSender handles.
Sourcepub fn weak_count(&self) -> usize
pub fn weak_count(&self) -> usize
Returns the number of WeakUnboundedSender handles.
Trait Implementations§
Source§impl<T> Clone for UnboundedSender<T>
impl<T> Clone for UnboundedSender<T>
Source§impl<T> Debug for UnboundedSender<T>
impl<T> Debug for UnboundedSender<T>
Source§impl<T> Drop for UnboundedSender<T>
impl<T> Drop for UnboundedSender<T>
Source§impl<T> Hash for UnboundedSender<T>
impl<T> Hash for UnboundedSender<T>
Source§impl<T> Ord for UnboundedSender<T>
impl<T> Ord for UnboundedSender<T>
Source§impl<T> PartialEq for UnboundedSender<T>
impl<T> PartialEq for UnboundedSender<T>
Source§impl<T> PartialOrd for UnboundedSender<T>
impl<T> PartialOrd for UnboundedSender<T>
impl<T> Eq for UnboundedSender<T>
Auto Trait Implementations§
impl<T> Freeze for UnboundedSender<T>
impl<T> RefUnwindSafe for UnboundedSender<T>
impl<T> Send for UnboundedSender<T>where
T: Send,
impl<T> Sync for UnboundedSender<T>where
T: Send,
impl<T> Unpin for UnboundedSender<T>
impl<T> UnwindSafe for UnboundedSender<T>
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