pub struct Sender<T> { /* private fields */ }Expand description
Sending half of the bounded channel; clone to add producers.
Implementations§
Source§impl<T> Sender<T>
impl<T> Sender<T>
Sourcepub fn send(&self, value: T) -> SendFuture<'_, T> ⓘ
pub fn send(&self, value: T) -> SendFuture<'_, T> ⓘ
Send a value, waiting for buffer capacity.
The returned future resolves Err(value) when the channel closes
before the value is accepted.
Sourcepub fn try_send(&self, value: T) -> Result<(), T>
pub fn try_send(&self, value: T) -> Result<(), T>
Send without waiting; returns the value when full or closed.
§Errors
Returns Err(value) when the buffer is at capacity or the channel
is closed.
Sourcepub fn sender_strong_count(&self) -> usize
pub fn sender_strong_count(&self) -> usize
Count of live sender handles.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Sender<T>
impl<T> RefUnwindSafe for Sender<T>
impl<T> Send for Sender<T>
impl<T> Sync for Sender<T>
impl<T> Unpin for Sender<T>
impl<T> UnsafeUnpin for Sender<T>
impl<T> UnwindSafe for Sender<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