Ready

Trait Ready 

Source
pub trait Ready {
    type Ok;
    type Err: Error + Send + Sync;

    // Required method
    fn poll_ready(&mut self, waker: &Waker) -> Poll<Result<Self::Ok, Self::Err>>;
}
Expand description

Determine if a struct is 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 ready, poll_ready should always return Poll::Ready.

Required Associated Types§

Source

type Ok

The type of successful values yielded by this trait.

Source

type Err: Error + Send + Sync

The type of failures yielded by this trait.

Required Methods§

Source

fn poll_ready(&mut self, waker: &Waker) -> Poll<Result<Self::Ok, Self::Err>>

Check if the stream can be read from.

Implementors§