[][src]Trait async_ready::AsyncReady

pub trait AsyncReady {
type Ok;
type Err: Error + Send + Sync;
    fn poll_ready(
        self: Pin<&mut Self>,
        cx: &mut Context
    ) -> Poll<Result<Self::Ok, Self::Err>>; fn poll_ready_unpin(
        &mut self,
        cx: &mut Context
    ) -> Poll<Result<Self::Ok, Self::Err>>
    where
        Self: Unpin + Sized
, { ... } }

Determine if a struct is async-ready to yield futures.

This is useful when a Stream borrows an internal struct, and the internal struct is in charge of establishing the io channel. That way the stream and the readiness can be decoupled.

Once the IO channel is async-ready, poll_async-ready should always return Poll::Ready.

Associated Types

type Ok

The type of successful values yielded by this trait.

type Err: Error + Send + Sync

The type of failures yielded by this trait.

Loading content...

Required methods

fn poll_ready(
    self: Pin<&mut Self>,
    cx: &mut Context
) -> Poll<Result<Self::Ok, Self::Err>>

Check if the stream can be read from.

Loading content...

Provided methods

fn poll_ready_unpin(
    &mut self,
    cx: &mut Context
) -> Poll<Result<Self::Ok, Self::Err>> where
    Self: Unpin + Sized

A convenience for calling AsyncReady::poll_ready on Unpin types.

Loading content...

Implementors

Loading content...