pub struct JobSender<T> { /* private fields */ }Expand description
The sending side of a job channel.
Implementations§
Source§impl<T> JobSender<T>
impl<T> JobSender<T>
Sourcepub fn try_send<F>(&self, msg: T, selector: F) -> Result<(), JobTrySendError<T>>where
F: FnMut(T, T) -> T,
pub fn try_send<F>(&self, msg: T, selector: F) -> Result<(), JobTrySendError<T>>where
F: FnMut(T, T) -> T,
Attempts to send a message into the job channel. If the channel already contains a message, selector
is applied to choose which one of them remains. Parallel senders might result in undefined message
selection, the failing sender will receive TrySendError::Full.
If the channel is closed, this method returns an error.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for JobSender<T>
impl<T> RefUnwindSafe for JobSender<T>
impl<T> Send for JobSender<T>where
T: Send,
impl<T> Sync for JobSender<T>where
T: Send,
impl<T> Unpin for JobSender<T>
impl<T> UnwindSafe for JobSender<T>
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more