Trait efs::io::Write

source ·
pub trait Write: Base {
    // Required methods
    fn write(&mut self, buf: &[u8]) -> Result<usize, Error<Self::IOError>>;
    fn flush(&mut self) -> Result<(), Error<Self::IOError>>;

    // Provided method
    fn write_all(&mut self, buf: &[u8]) -> Result<(), Error<Self::IOError>> { ... }
}
Expand description

Allows for writing bytes to a destination.

See [std::io::Write] for more information: this trait is a no_std based variant.

Required Methods§

source

fn write(&mut self, buf: &[u8]) -> Result<usize, Error<Self::IOError>>

Write a buffer into this writer, returning how many bytes were written.

If the returned number is 0, either the writer is ended or cannot add any more bytes at its end.

On a Seekable writer, a call to this function should increase the offset by the amount of bytes read.

See write for more information.

§Errors

Returns an DevError if the device on which the directory is located could not be written.

source

fn flush(&mut self) -> Result<(), Error<Self::IOError>>

Flush this output stream, ensuring that all intermediately buffered contents reach their destination.

See flush for more information.

§Errors

Returns an DevError if the device on which the directory is located could not be read.

Provided Methods§

source

fn write_all(&mut self, buf: &[u8]) -> Result<(), Error<Self::IOError>>

Attempts to write an entire buffer into this writer.

See write_all for more information.

§Errors

Returns a WriteZero error if the buffer could not be written entirely.

Otherwise, returns the same errors as write.

Implementors§

source§

impl<Dev: Device<u8, Ext2Error>> Write for Block<Dev>

source§

impl<Dev: Device<u8, Ext2Error>> Write for File<Dev>

source§

impl<Dev: Device<u8, Ext2Error>> Write for Regular<Dev>