Trait Layer2Data

Source
pub trait Layer2Data: Debug + Default {
    type LoadError: Error;
    type StoreError: Error;

    // Required methods
    fn load(path: &Path) -> Result<Self, Self::LoadError>
       where Self: Sized;
    fn store(&self, path: &Path) -> Result<(), Self::StoreError>;
}

Required Associated Types§

Required Methods§

Source

fn load(path: &Path) -> Result<Self, Self::LoadError>
where Self: Sized,

Source

fn store(&self, path: &Path) -> Result<(), Self::StoreError>

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.

Implementations on Foreign Types§

Source§

impl Layer2Data for Option<ImpossibleLayer2>

Source§

type LoadError = Infallible

Source§

type StoreError = Infallible

Source§

fn load( _: &Path, ) -> Result<Option<ImpossibleLayer2>, <Option<ImpossibleLayer2> as Layer2Data>::LoadError>

Source§

fn store( &self, _: &Path, ) -> Result<(), <Option<ImpossibleLayer2> as Layer2Data>::StoreError>

Implementors§