pub struct Sender<'a, T, const N: usize>(/* private fields */);
Expand description
A Sender
can send to the channel and can be cloned.
Implementations§
Source§impl<T, const N: usize> Sender<'_, T, N>
impl<T, const N: usize> Sender<'_, T, N>
Sourcepub fn try_send(&mut self, val: T) -> Result<(), TrySendError<T>>
pub fn try_send(&mut self, val: T) -> Result<(), TrySendError<T>>
Try to send a value, non-blocking. If the channel is full this will return an error.
Sourcepub async fn send(&mut self, val: T) -> Result<(), NoReceiver<T>>
pub async fn send(&mut self, val: T) -> Result<(), NoReceiver<T>>
Send a value. If there is no place left in the queue this will wait until there is. If the receiver does not exist this will return an error.
Trait Implementations§
impl<T, const N: usize> Send for Sender<'_, T, N>
Auto Trait Implementations§
impl<'a, T, const N: usize> Freeze for Sender<'a, T, N>
impl<'a, T, const N: usize> !RefUnwindSafe for Sender<'a, T, N>
impl<'a, T, const N: usize> Sync for Sender<'a, T, N>
impl<'a, T, const N: usize> Unpin for Sender<'a, T, N>
impl<'a, T, const N: usize> !UnwindSafe for Sender<'a, T, N>
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