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§
sourcefn write(&mut self, buf: &[u8]) -> Result<usize, Error<Self::IOError>>
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.