Trait midly::io::Write

source ·
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§

The error type specific to the writer.

Self when the type is seekable, and NotSeekable<Self> otherwise.

Required Methods§

Write a slice of data to the writer.

Should error if not all of the data could be written.

Create an “invalid input”-style error from a string literal.

Provided Methods§

Make this writer seekable, if possible.

Implementations on Foreign Types§

Implementors§