Trait ChannelCompatRecv

Source
pub trait ChannelCompatRecv: Send {
    type Data: AsRef<[u8]>;

    // Required methods
    fn channel_recv(&mut self) -> Option<Self::Data>;
    fn try_channel_recv(&mut self) -> Option<Self::Data>;

    // Provided method
    fn into_compat(self) -> ChannelCompat<Self> 
       where Self: Sized { ... }
}
Available on crate feature channel only.
Expand description

A trait that represents a channel that can be read from.

Required Associated Types§

Source

type Data: AsRef<[u8]>

The type of data that the channel can receive.

Required Methods§

Source

fn channel_recv(&mut self) -> Option<Self::Data>

Receives data from the channel.

Source

fn try_channel_recv(&mut self) -> Option<Self::Data>

Tries to receive data from the channel.

Provided Methods§

Source

fn into_compat(self) -> ChannelCompat<Self>
where Self: Sized,

Converts the channel to a ChannelCompat instance.

Implementations on Foreign Types§

Source§

impl<D: AsRef<[u8]> + Clone + Send> ChannelCompatRecv for Receiver<D>

Available on crate feature tokio-channel only.
Source§

type Data = D

Source§

fn channel_recv(&mut self) -> Option<Self::Data>

Source§

fn try_channel_recv(&mut self) -> Option<Self::Data>

Source§

impl<D: AsRef<[u8]> + Send> ChannelCompatRecv for Receiver<D>

Source§

type Data = D

Source§

fn channel_recv(&mut self) -> Option<Self::Data>

Source§

fn try_channel_recv(&mut self) -> Option<Self::Data>

Source§

impl<D: AsRef<[u8]> + Send> ChannelCompatRecv for Receiver<D>

Available on crate feature tokio-channel only.
Source§

type Data = D

Source§

fn channel_recv(&mut self) -> Option<Self::Data>

Source§

fn try_channel_recv(&mut self) -> Option<Self::Data>

Source§

impl<D: AsRef<[u8]> + Send> ChannelCompatRecv for Receiver<D>

Available on crate feature crossbeam-channel only.
Source§

type Data = D

Source§

fn channel_recv(&mut self) -> Option<Self::Data>

Source§

fn try_channel_recv(&mut self) -> Option<Self::Data>

Source§

impl<D: AsRef<[u8]> + Send> ChannelCompatRecv for UnboundedReceiver<D>

Available on crate feature tokio-channel only.
Source§

type Data = D

Source§

fn channel_recv(&mut self) -> Option<Self::Data>

Source§

fn try_channel_recv(&mut self) -> Option<Self::Data>

Implementors§