Trait lockchain_core::traits::FileIO [−][src]
pub trait FileIO: AutoEncoder { fn load(path: &str) -> Result<Self, Box<Error>> { ... } fn save(&self, path: &str) -> Result<(), Box<Error>> { ... } }
An abstract file loading utility trait
Any type that implements FileIO also has to be
AutoEncoder in order to be storable. This trait implements
common file I/O operations, assuming that any type using it
will then provide the required utility functions.
Provided Methods
fn load(path: &str) -> Result<Self, Box<Error>>
Load a type from a file path
fn save(&self, path: &str) -> Result<(), Box<Error>>
Store a type to a file path