pub struct PersistedState<T>{ /* private fields */ }
Expand description
Container that holds some state value that is persisted to disk.
Implementations§
Source§impl<T> PersistedState<T>
impl<T> PersistedState<T>
Sourcepub fn new(path: PathBuf) -> PersistedState<T>
pub fn new(path: PathBuf) -> PersistedState<T>
Creates a new state container that persists to the given path.
Sourcepub fn new_with_mode(path: PathBuf, mode: u32) -> PersistedState<T>
pub fn new_with_mode(path: PathBuf, mode: u32) -> PersistedState<T>
Creates a new state container that persists to the given path.
Sourcepub fn save(&self, state: T) -> Result<(), WrappedError>
pub fn save(&self, state: T) -> Result<(), WrappedError>
Saves persisted state.
Trait Implementations§
Source§impl<T> Clone for PersistedState<T>
impl<T> Clone for PersistedState<T>
Source§fn clone(&self) -> PersistedState<T>
fn clone(&self) -> PersistedState<T>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl<T> Freeze for PersistedState<T>
impl<T> RefUnwindSafe for PersistedState<T>
impl<T> Send for PersistedState<T>where
T: Send,
impl<T> Sync for PersistedState<T>where
T: Send,
impl<T> Unpin for PersistedState<T>
impl<T> UnwindSafe for PersistedState<T>
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