RawChan

Trait RawChan 

Source
pub trait RawChan {
    type R;
    type SendFuture<'a>: Future<Output = Result<(), Error>> + 'a
       where Self: 'a;
    type RecvFuture<'a>: Future<Output = Result<Self::R, Error>>
       where Self: 'a;
    type CloseFuture: Future<Output = Result<(), Error>> + 'static;

    // Required methods
    fn send(&mut self, r: Self::R) -> Self::SendFuture<'_>;
    fn recv(&mut self) -> Self::RecvFuture<'_>;
    fn close(self) -> Self::CloseFuture;
}

Required Associated Types§

Source

type R

Source

type SendFuture<'a>: Future<Output = Result<(), Error>> + 'a where Self: 'a

Source

type RecvFuture<'a>: Future<Output = Result<Self::R, Error>> where Self: 'a

Source

type CloseFuture: Future<Output = Result<(), Error>> + 'static

Required Methods§

Source

fn send(&mut self, r: Self::R) -> Self::SendFuture<'_>

Source

fn recv(&mut self) -> Self::RecvFuture<'_>

Source

fn close(self) -> Self::CloseFuture

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<R: Sync + Send + 'static> RawChan for Mpsc<R>

Source§

type R = R

Source§

type SendFuture<'a> = impl Future<Output = Result<(), Error>> + 'a where Self: 'a

Source§

type RecvFuture<'a> = impl Future<Output = Result<R, Error>> + 'a where Self: 'a

Source§

type CloseFuture = impl Future<Output = Result<(), Error>> + 'static