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>
impl<T> Eq 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>
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<T> PartialEq for UnboundedSender<T>
impl<T> PartialEq for UnboundedSender<T>
Source§impl<T> PartialOrd for UnboundedSender<T>
impl<T> PartialOrd for UnboundedSender<T>
Auto Trait Implementations§
impl<T> Freeze for UnboundedSender<T>
impl<T> RefUnwindSafe for UnboundedSender<T>where
Arc<Shared<T>>: RefUnwindSafe,
impl<T> Send for UnboundedSender<T>
impl<T> Sync for UnboundedSender<T>
impl<T> Unpin for UnboundedSender<T>
impl<T> UnsafeUnpin for UnboundedSender<T>where
Arc<Shared<T>>: UnsafeUnpin,
impl<T> UnwindSafe for UnboundedSender<T>where
Arc<Shared<T>>: UnwindSafe,
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