Trait File

Source
pub trait File: Into<String> + TryFrom<String> {
    type ReadError;
    type WriteError;

    // Required methods
    fn read<P>(path: P) -> Result<Self, Self::ReadError>
       where P: Into<PathBuf>;
    fn write<P>(self, path: P) -> Result<(), Self::WriteError>
       where P: Into<PathBuf>;
}
Expand description

I/O file format trait.

Required Associated Types§

Source

type ReadError

Read format from path error.

Source

type WriteError

Write format to path error.

Required Methods§

Source

fn read<P>(path: P) -> Result<Self, Self::ReadError>
where P: Into<PathBuf>,

Read format from a given path.

Source

fn write<P>(self, path: P) -> Result<(), Self::WriteError>
where P: Into<PathBuf>,

Write format to a given path.

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§