Trait netio::WriteExt [] [src]

pub trait WriteExt: Write {
    fn retry(self) -> Retry<Self> where Self: Sized { ... }
    fn write_all_net(&mut self, buf: &mut &[u8]) -> Result<()> { ... }
}

Extension methods for std::io::Write

This trait is automatically implemented for all types that implement std::io::Write.

Provided Methods

fn retry(self) -> Retry<Self> where Self: Sized

Transforms this writer into a writer that automatically retries on interrupts

The returned adapter will behave identically to the original reader, except that it retries the writing operation automatically if an error of kind ErrorKind::Interrupted occurs.

Note

Methods that are already expected to retry are forwarded directly to the underlying writer.

fn write_all_net(&mut self, buf: &mut &[u8]) -> Result<()>

Attempts to write an entire buffer into this write.

This method will continuously call write while there is more data to write. This method will not return until the entire buffer has been successfully written or an error occurs. The first error generated from this method will be returned.

The supplied buffer will be consumed by the writing operation.

Errors

This function will return an error immediately if any call to write returns any kind of error. Instances of ErrorKind::Interrupted are not handled by this function.

All bytes consumed from the buffer will be written to the the writer and vice versa. It is guaranteed that no data is lost in case of error.

Implementors