pub struct Sender<T> { /* private fields */ }Expand description
Sending half of an mpsc channel.
Can be cloned to create multiple producers.
Implementations§
Source§impl<T> Sender<T>
impl<T> Sender<T>
Sourcepub fn try_send(&self, value: T) -> Result<(), TrySendError<T>>
pub fn try_send(&self, value: T) -> Result<(), TrySendError<T>>
Try to send a value without blocking.
Returns Ok(()) if the value was queued. Returns
TrySendError::Full if the channel is at capacity, or
TrySendError::Disconnected if the receiver was dropped.
Sourcepub fn send(&self, value: T) -> SendFuture<'_, T> ⓘ
pub fn send(&self, value: T) -> SendFuture<'_, T> ⓘ
Send a value, returning a future that resolves when the value is queued.
If the channel has capacity, the future resolves immediately. If the channel is full, the future parks until the receiver drains a slot.
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