Trait ajour_core::fs::PersistentData [−][src]
Defines a serializable struct that should persist on the filesystem inside the Ajour config directory.
Required methods
fn relative_path() -> PathBuf
[src]
Only method required to implement PersistentData on an object. Always relative to the config folder for Ajour.
Provided methods
fn path() -> Result<PathBuf, FilesystemError>
[src]
Returns the full file path. Will create any parent directories that don’t exist.
fn load() -> Result<Self, FilesystemError>
[src]
Load from PersistentData::path()
.
fn load_or_default<T: PersistentData + Default>() -> Result<T, FilesystemError>
[src]
Load from PersistentData::path()
. If file doesn’t exist, save it to the filesystem as Default
and return that object.
fn save(&self) -> Result<(), FilesystemError>
[src]
Save to PersistentData::path()