FileContent

Trait FileContent 

Source
pub trait FileContent: StrictArmor {
    const MAGIC: [u8; 3];

    // Provided methods
    fn load(data: impl Read) -> Result<Self, LoadError> { ... }
    fn save(&self, writer: impl Write) -> Result<(), Error> { ... }
    fn load_file(path: impl AsRef<Path>) -> Result<Self, LoadError> { ... }
    fn save_file(&self, path: impl AsRef<Path>) -> Result<(), Error> { ... }
    fn load_armored(path: impl AsRef<Path>) -> Result<Self, LoadError> { ... }
    fn save_armored(&self, path: impl AsRef<Path>) -> Result<(), Error> { ... }
}

Required Associated Constants§

Source

const MAGIC: [u8; 3]

Magic bytes used in saving/restoring container from a file.

Provided Methods§

Source

fn load(data: impl Read) -> Result<Self, LoadError>

Source

fn save(&self, writer: impl Write) -> Result<(), Error>

Source

fn load_file(path: impl AsRef<Path>) -> Result<Self, LoadError>

Source

fn save_file(&self, path: impl AsRef<Path>) -> Result<(), Error>

Source

fn load_armored(path: impl AsRef<Path>) -> Result<Self, LoadError>

Source

fn save_armored(&self, path: impl AsRef<Path>) -> Result<(), Error>

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§