pub struct FileStateStore { /* private fields */ }Expand description
config.toml and state.toml in one directory: gv’s layout.
Implementations§
Source§impl FileStateStore
impl FileStateStore
Sourcepub fn new(dir: impl Into<PathBuf>) -> FileStateStore
pub fn new(dir: impl Into<PathBuf>) -> FileStateStore
The store in dir (created on the first save).
Sourcepub fn config_path(&self) -> PathBuf
pub fn config_path(&self) -> PathBuf
<dir>/config.toml.
Sourcepub fn state_path(&self) -> PathBuf
pub fn state_path(&self) -> PathBuf
<dir>/state.toml.
Trait Implementations§
Source§impl Clone for FileStateStore
impl Clone for FileStateStore
Source§impl Debug for FileStateStore
impl Debug for FileStateStore
Source§impl StateStore for FileStateStore
impl StateStore for FileStateStore
Source§fn load(&self) -> Result<LocalState, StoreError>
fn load(&self) -> Result<LocalState, StoreError>
The state as last saved.
Source§fn save(&self, state: &LocalState) -> Result<(), StoreError>
fn save(&self, state: &LocalState) -> Result<(), StoreError>
Save the whole state.
Auto Trait Implementations§
impl Freeze for FileStateStore
impl RefUnwindSafe for FileStateStore
impl Send for FileStateStore
impl Sync for FileStateStore
impl Unpin for FileStateStore
impl UnsafeUnpin for FileStateStore
impl UnwindSafe for FileStateStore
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more