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§

source

type Message

The message that will be sent.

Required Methods§

source

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.

Implementations on Foreign Types§

source§

impl<T> TrySend for Sender<T>where T: Send,

§

type Message = T

source§

fn try_send( &self, item: <Sender<T> as TrySend>::Message ) -> Result<(), TrySendError>

Implementors§