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<'a, T, const N: usize> Sender<'a, T, N>
impl<'a, T, const N: usize> Sender<'a, 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<'a, T, const N: usize> Send for Sender<'a, 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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)