FileWriter

Trait FileWriter 

Source
pub trait FileWriter {
    type File: EraFileFormat<Id: EraFileId>;

    // Required methods
    fn create<P: AsRef<Path>>(
        path: P,
        file: &Self::File,
    ) -> Result<(), E2sError>;
    fn create_with_id<P: AsRef<Path>>(
        directory: P,
        file: &Self::File,
    ) -> Result<(), E2sError>;
}
Expand description

StreamWriter provides writing file operations for era files

Required Associated Types§

Source

type File: EraFileFormat<Id: EraFileId>

Era file type the writer handles

Required Methods§

Source

fn create<P: AsRef<Path>>(path: P, file: &Self::File) -> Result<(), E2sError>

Creates a new file at the specified path and writes the era file to it

Source

fn create_with_id<P: AsRef<Path>>( directory: P, file: &Self::File, ) -> Result<(), E2sError>

Creates a file in the directory using standardized era naming

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§