Trait Write

Source
pub trait Write {
    type Input;

    const ID_BYTES: [u8; 4];
    const OUTPUT_VERSION: u32;

    // Required method
    fn write(self, input: Self::Input) -> Result<()>;
}
Expand description

Contains logic for writing a specific file format.

Required Associated Constants§

Source

const ID_BYTES: [u8; 4]

The “magic number” bytes identifying the type of file.

Source

const OUTPUT_VERSION: u32

The version of the file format this writer will create.

Required Associated Types§

Source

type Input

The result of successfully parsing a file.

Required Methods§

Source

fn write(self, input: Self::Input) -> Result<()>

Attempts to create a file with the given format’s semantics.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl Write for Writer

Source§

const ID_BYTES: [u8; 4] = super::ID_BYTES

Source§

const OUTPUT_VERSION: u32 = 18u32

Source§

type Input = PathBuf