pub trait ToWriter: Sized {
    // Required method
    fn to_writer(&self, w: &mut impl Write) -> Result<()>;

    // Provided method
    fn write_to_file(self, path: &Path) -> Result<()> { ... }
}
Expand description

Trait for data types that can be written to a writer.

Required Methods§

source

fn to_writer(&self, w: &mut impl Write) -> Result<()>

Writes out self.

Provided Methods§

source

fn write_to_file(self, path: &Path) -> Result<()>

Writes self to a file at path in binary format.

Implementors§