pub trait DirStructureItem: ReadFrom + WriteTo {
    // Provided methods
    fn read(path: impl AsRef<Path>) -> Result<Self>
       where Self: Sized { ... }
    fn write(&self, path: impl AsRef<Path>) -> Result<()> { ... }
}
Expand description

Helper trait, implemented for all types that have a ReadFrom and WriteTo implementation.

Provided Methods§

source

fn read(path: impl AsRef<Path>) -> Result<Self>where Self: Sized,

Uses the ReadFrom implementation to read the structure from disk, from the specified path.

source

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

Uses the WriteTo implementation to write the structure to disk at the specified path.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<T> DirStructureItem for Twhere T: ReadFrom + WriteTo,