pub struct WorkerSender<Up: Send> { /* private fields */ }Expand description
A wrapper around Sender<UpMsg<Up>>. This type implements !Send,
as RecvAllIterator depends on this type being dropped whenever the thread holding it stops or panics.
Implementations§
Source§impl<Up: Send> WorkerSender<Up>
impl<Up: Send> WorkerSender<Up>
Sourcepub fn send(&self, msg: Up) -> Result<(), SendError<Up>>
pub fn send(&self, msg: Up) -> Result<(), SendError<Up>>
Sends a value on the channel, blocking if the channel is full.
The value is wrapped in an UpMsg
Sourcepub fn try_send(&self, msg: Up) -> Result<(), TrySendError<Up>>
pub fn try_send(&self, msg: Up) -> Result<(), TrySendError<Up>>
Tries to send a value on the channel. If the channel is full, then TrySendError::Full is returned instead.
Trait Implementations§
Source§impl<Up: Clone + Send> Clone for WorkerSender<Up>
impl<Up: Clone + Send> Clone for WorkerSender<Up>
Source§fn clone(&self) -> WorkerSender<Up>
fn clone(&self) -> WorkerSender<Up>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl<Up: Send> !Send for WorkerSender<Up>
Auto Trait Implementations§
impl<Up> Freeze for WorkerSender<Up>
impl<Up> RefUnwindSafe for WorkerSender<Up>
impl<Up> Sync for WorkerSender<Up>
impl<Up> Unpin for WorkerSender<Up>
impl<Up> UnwindSafe for WorkerSender<Up>
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