Trait flag_algebra::operator::Savable
source · pub trait Savable<A, F>{
// Required methods
fn filename(&self) -> String;
fn create(&self) -> A;
// Provided methods
fn file_path(&self) -> PathBuf { ... }
fn create_and_save(&self, path: &Path) -> A { ... }
fn load(&self, path: &Path) -> Result<A, Box<dyn Error>> { ... }
fn get(&self) -> A { ... }
}
Expand description
A trait for flag operators that can be saved in a file once computed for the first time.
A
is the type of the stored object.
The operator operate on flags of type F
.
Required Methods§
Provided Methods§
sourcefn create_and_save(&self, path: &Path) -> A
fn create_and_save(&self, path: &Path) -> A
(Re)create the object, save it in the corresponding file and return it.