Trait littlefs2::io::Write[][src]

pub trait Write {
    fn write(&self, data: &[u8]) -> Result<usize>;
fn flush(&self) -> Result<()>; fn write_all(&self, buf: &[u8]) -> Result<()> { ... } }

The Write trait allows for writing bytes to a file.

By analogy with std::io::Write, we also define a flush() method. In the current implementation, writes are final and flush has no effect.

Required methods

fn write(&self, data: &[u8]) -> Result<usize>[src]

Write at most data.len() bytes. The file will not necessarily be updated unless flush is called as there is a cache. Upon success, return how many bytes were written.

fn flush(&self) -> Result<()>[src]

Write out all pending writes to storage.

Loading content...

Provided methods

fn write_all(&self, buf: &[u8]) -> Result<()>[src]

Loading content...

Implementors

impl<S: Storage> Write for File<'_, '_, S>[src]

Loading content...