pub struct Sender<T> { /* private fields */ }
Expand description
The sending side of a channel.
Implementations§
Source§impl<T> Sender<T>
impl<T> Sender<T>
Sourcepub fn send_timeout<D>(&self, msg: T, timeout: D) -> Result<(), SendError<T>>
pub fn send_timeout<D>(&self, msg: T, timeout: D) -> Result<(), SendError<T>>
Waits for a message to be sent into the channel, but only for a limited time.
This call will block until the send operation can proceed or the operation times out.
For unbounded channels, this will perform an allocation (and always send immediately). For bounded channels, no allocation will be performed.
Sourcepub fn send(&self, msg: T) -> Result<(), SendError<T>>
pub fn send(&self, msg: T) -> Result<(), SendError<T>>
Sends a message over the given channel. Waiting if necessary.
For unbounded channels, this will allocate space for a message, and immediately send it. For bounded channels, this will block until a message slot is available, and then send the message.
Trait Implementations§
impl<T: Send> Send for Sender<T>
impl<T: Send> Sync for Sender<T>
Auto Trait Implementations§
impl<T> Freeze for Sender<T>
impl<T> !RefUnwindSafe for Sender<T>
impl<T> Unpin for Sender<T>where
T: Unpin,
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