pub fn try_send(&mut self, value: T) -> Result<(), TrySendError<T>> {
        if let Some(channel) = self.channel.take() {
            match unsafe { channel.to_ref() }.write(value, None, false) {
                Ok(()) => {
                    self.channel.replace(channel);
                    Ok(())
                }
                Err((value, dropped)) => {
                    if dropped {
                        unsafe { channel.dealloc() };
                    } else {
                        self.channel.replace(channel);
                    }
                    Err(if dropped {
                        TrySendError::Disconnected(value)
                    } else {
                        TrySendError::Full(value)
                    })
                }
            }
        } else {
            Err(TrySendError::Disconnected(value))
        }
    }
/// Try to send the next message
Try to send the next message
Try to send the next message
pub fn try_send(&mut self, value: T) -> Result<(), TrySendError<T>> {
        if let Some(channel) = self.channel.take() {
            match unsafe { channel.to_ref() }.write(value, None, false) {
                Ok(()) => {
                    self.channel.replace(channel);
                    Ok(())
                }
                Err((value, dropped)) => {
                    if dropped {
                        unsafe { channel.dealloc() };
                    } else {
                        self.channel.replace(channel);
                    }
                    Err(if dropped {
                        TrySendError::Disconnected(value)
                    } else {
                        TrySendError::Full(value)
                    })
                }
            }
        } else {
            Err(TrySendError::Disconnected(value))
        }
    }
pub fn try_send ( & mut self , value : T ) -> Result < ( ) , TrySendError < T > > { if let Some ( channel ) = self . channel . take ( ) { match unsafe { channel . to_ref ( ) } . write ( value , None , false ) { Ok ( ( ) ) => { self . channel . replace ( channel ) ; Ok ( ( ) ) } Err ( ( value , dropped ) ) => { if dropped { unsafe { channel . dealloc ( ) } ; } else { self . channel . replace ( channel ) ; } Err ( if dropped { TrySendError :: Disconnected ( value ) } else { TrySendError :: Full ( value ) } ) } } } else { Err ( TrySendError :: Disconnected ( value ) ) } }
Try to send the next message
Try to send the next message
&mut self
value
T
&mut self
value
T