/// Attempt to send the value without waiting.
///
/// This operation is not supported for unbuffered channels and will
/// panic if the capacity of the `RingBuf` is zero. The reason for this is
/// that the actual value transfer on unbuffered channels always happens
/// when a receiving task copies the value out of the sending task while it
/// is waiting. If the sending task does not wait, the value can not be
/// transferred. Since this method can therefore never yield a reasonable
/// result with unbuffered channels, it panics in order to highlight the
/// use of an inappropriate API.
Attempt to send the value without waiting.
This operation is not supported for unbuffered channels and will
panic if the capacity of the `RingBuf` is zero. The reason for this is
that the actual value transfer on unbuffered channels always happens
when a receiving task copies the value out of the sending task while it
is waiting. If the sending task does not wait, the value can not be
transferred. Since this method can therefore never yield a reasonable
result with unbuffered channels, it panics in order to highlight the
use of an inappropriate API.
Attempt to send the value without waiting . This operation is not supported for unbuffered channels and will panic if the capacity of the ` RingBuf ` is zero . The reason for this is that the actual value transfer on unbuffered channels always happens when a receiving task copies the value out of the sending task while it is waiting . If the sending task does not wait the value can not be transferred . Since this method can therefore never yield a reasonable result with unbuffered channels it panics in order to highlight the use of an inappropriate API .
pub fn try_send(&self, value: T) -> Result<(), TrySendError<T>> {
        let result = { self.inner.lock().try_send(value) };
        match result {
            Ok(Some(waker)) => {
                waker.wake();
                Ok(())
            }
            Ok(None) => Ok(()),
            Err(e) => Err(e),
        }
    }
pub fn try_send ( & self , value : T ) -> Result < ( ) , TrySendError < T > > { let result = { self . inner . lock ( ) . try_send ( value ) } ; match result { Ok ( Some ( waker ) ) => { waker . wake ( ) ; Ok ( ( ) ) } Ok ( None ) => Ok ( ( ) ) , Err ( e ) => Err ( e ) , } }
Attempt to send the value without waiting.
Attempt to send the value without waiting .
&self
value
T