embedded_io

Trait ReadReady

Source
pub trait ReadReady: ErrorType {
    // Required method
    fn read_ready(&mut self) -> Result<bool, Self::Error>;
}
Expand description

Get whether a reader is ready.

This allows using a Read or BufRead in a nonblocking fashion, i.e. trying to read only when it is ready.

Required Methods§

Source

fn read_ready(&mut self) -> Result<bool, Self::Error>

Get whether the reader is ready for immediately reading.

This usually means that there is either some bytes have been received and are buffered and ready to be read, or that the reader is at EOF.

If this returns true, it’s guaranteed that the next call to Read::read or BufRead::fill_buf will not block.

Implementations on Foreign Types§

Source§

impl<T: ?Sized + ReadReady> ReadReady for &mut T

Source§

fn read_ready(&mut self) -> Result<bool, Self::Error>

Implementors§