pub trait Write {
type Error;
type Seekable: Write<Error = Self::Error, Seekable = Self::Seekable> + Seek;
fn write(&mut self, buf: &[u8]) -> WriteResult<Self>;
fn invalid_input(msg: &'static str) -> Self::Error;
fn make_seekable(&mut self) -> Option<&mut Self::Seekable> { ... }
}
Expand description
A Write
trait available even in no_std
environments, and with per-type errors.
Required Associated Types§
Required Methods§
sourcefn write(&mut self, buf: &[u8]) -> WriteResult<Self>
fn write(&mut self, buf: &[u8]) -> WriteResult<Self>
Write a slice of data to the writer.
Should error if not all of the data could be written.
sourcefn invalid_input(msg: &'static str) -> Self::Error
fn invalid_input(msg: &'static str) -> Self::Error
Create an “invalid input”-style error from a string literal.
Provided Methods§
sourcefn make_seekable(&mut self) -> Option<&mut Self::Seekable>
fn make_seekable(&mut self) -> Option<&mut Self::Seekable>
Make this writer seekable, if possible.