Skip to main content

WriteReady

Trait WriteReady 

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

Get whether a writer is ready.

This allows using a [Write] in a nonblocking fashion, i.e. trying to write only when it is ready.

Required Methods§

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

Get whether the writer is ready for immediately writing.

This usually means that there is free space in the internal transmit buffer.

If this returns true, it’s guaranteed that the next call to [Write::write] will not block.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

§

impl WriteReady for &mut [u8]

§

fn write_ready(&mut self) -> Result<bool, <&mut [u8] as ErrorType>::Error>

§

impl<T> WriteReady for &mut T
where T: WriteReady + ?Sized,

§

fn write_ready(&mut self) -> Result<bool, <&mut T as ErrorType>::Error>

Implementors§