pub fn try_send<M>(&self, msg: M, park: bool) -> Result<(), SendError<M>>
    where
        A: Handler<M>,
        <A as Actor>::Context: ToEnvelope<A, M>,
        M::Result: Send,
        M: Message + Send + 'static,
    {
        // If the sender is currently blocked, reject the message
        if !self.poll_unparked(false, None).is_ready() {
            return Err(SendError::Full(msg));
        }

        let park_self = match self.inc_num_messages() {
            Some(num_messages) => {
                // receiver is full
                let buffer = self.inner.buffer.load(Relaxed);
                buffer != 0 && num_messages >= buffer
            }
            None => return Err(SendError::Closed(msg)),
        };

        if park_self && park {
            self.park();
        }
        let env = <A::Context as ToEnvelope<A, M>>::pack(msg, None);
        self.queue_push_and_signal(env);
        Ok(())
    }
/// Attempts to send a message on this `Sender<A>` without blocking.
Attempts to send a message on this `Sender` without blocking.
Attempts to send a message on this ` Sender ` without blocking .
pub fn try_send<M>(&self, msg: M, park: bool) -> Result<(), SendError<M>>
    where
        A: Handler<M>,
        <A as Actor>::Context: ToEnvelope<A, M>,
        M::Result: Send,
        M: Message + Send + 'static,
    {
        // If the sender is currently blocked, reject the message
        if !self.poll_unparked(false, None).is_ready() {
            return Err(SendError::Full(msg));
        }
        let park_self = match self.inc_num_messages() {
            Some(num_messages) => {
                // receiver is full
                let buffer = self.inner.buffer.load(Relaxed);
                buffer != 0 && num_messages >= buffer
            }
            None => return Err(SendError::Closed(msg)),
        };
        if park_self && park {
            self.park();
        }
        let env = <A::Context as ToEnvelope<A, M>>::pack(msg, None);
        self.queue_push_and_signal(env);
        Ok(())
    }
pub fn try_send < M > ( & self , msg : M , park : bool ) -> Result < ( ) , SendError < M > > where A : Handler < M > , < A as Actor > :: Context : ToEnvelope < A , M > , M :: Result : Send , M : Message + Send + ' static , { // If the sender is currently blocked, reject the message if ! self . poll_unparked ( false , None ) . is_ready ( ) { return Err ( SendError :: Full ( msg ) ) ; } let park_self = match self . inc_num_messages ( ) { Some ( num_messages ) => { // receiver is full let buffer = self . inner . buffer . load ( Relaxed ) ; buffer != 0 && num_messages >= buffer } None => return Err ( SendError :: Closed ( msg ) ) , } ; if park_self && park { self . park ( ) ; } let env = < A :: Context as ToEnvelope < A , M > > :: pack ( msg , None ) ; self . queue_push_and_signal ( env ) ; Ok ( ( ) ) }
Attempts to send a message on this `Sender<A>` without blocking.
Attempts to send a message on this ` Sender<A > ` without blocking .
&self
msg
M
park
bool
&self
msg
M
park
bool