Trait TrySend
pub trait TrySend: Sync + Send {
type Message;
// Required method
fn try_send(&self, item: Self::Message) -> Result<(), TrySendError>;
}
Expand description
TrySend is an abstraction of Sender
that is capable of sending messages through a reference.
Required Associated Types§
type Message
type Message
The message that will be sent.
Required Methods§
fn try_send(&self, item: Self::Message) -> Result<(), TrySendError>
fn try_send(&self, item: Self::Message) -> Result<(), TrySendError>
Try to send a message batch to a worker thread.
A failure can be due to either a closed receiver, or a depleted buffer.