fn try_receive(&mut self) -> Result<(T, Option<Waker>), TryReceiveError> {
        if !self.buffer.is_empty() {
            let val = self.buffer.pop();

            // Since this means a space in the buffer had been freed,
            // try to copy a value from a potential waiter into the channel.
            let waker = self.try_copy_value_from_oldest_waiter();

            Ok((val, waker))
        } else if let Some((val, waker)) = self.try_take_value_from_sender() {
            Ok((val, waker))
        } else if self.is_closed {
            Err(TryReceiveError::Closed)
        } else {
            Err(TryReceiveError::Empty)
        }
    }
/// Tries to receive a value from the channel without waiting.
Tries to receive a value from the channel without waiting.
Tries to receive a value from the channel without waiting .
fn try_receive(&mut self) -> Result<(T, Option<Waker>), TryReceiveError> {
        if !self.buffer.is_empty() {
            let val = self.buffer.pop();
            // Since this means a space in the buffer had been freed,
            // try to copy a value from a potential waiter into the channel.
            let waker = self.try_copy_value_from_oldest_waiter();
            Ok((val, waker))
        } else if let Some((val, waker)) = self.try_take_value_from_sender() {
            Ok((val, waker))
        } else if self.is_closed {
            Err(TryReceiveError::Closed)
        } else {
            Err(TryReceiveError::Empty)
        }
    }
fn try_receive ( & mut self ) -> Result < ( T , Option < Waker > ) , TryReceiveError > { if ! self . buffer . is_empty ( ) { let val = self . buffer . pop ( ) ; // Since this means a space in the buffer had been freed, // try to copy a value from a potential waiter into the channel. let waker = self . try_copy_value_from_oldest_waiter ( ) ; Ok ( ( val , waker ) ) } else if let Some ( ( val , waker ) ) = self . try_take_value_from_sender ( ) { Ok ( ( val , waker ) ) } else if self . is_closed { Err ( TryReceiveError :: Closed ) } else { Err ( TryReceiveError :: Empty ) } }
Tries to receive a value from the channel without waiting.
Tries to receive a value from the channel without waiting .
&mut self
&mut self