pub struct PersistedClock { /* private fields */ }Expand description
A Clock implementation, that can be persisted to
disk, via the from_path or
save_to_file functions.
Implementations§
Source§impl PersistedClock
impl PersistedClock
Sourcepub fn new(path: PathBuf) -> Result<Self, Error>
pub fn new(path: PathBuf) -> Result<Self, Error>
Create a new PersistedClock.
This will override the contents of path.
If you want to re-load a previously persisted clock, use
PersistedClock::from_path.
§Errors
If the path cannot be opened for writing.
Sourcepub fn from_path(path: PathBuf) -> Result<Self, Error>
pub fn from_path(path: PathBuf) -> Result<Self, Error>
Loads this clock from a previously persisted clock.
§Errors
If the path cannot be opened for reading and writing.
Trait Implementations§
Source§impl Clock for PersistedClock
impl Clock for PersistedClock
Source§type IncrementError = Error
type IncrementError = Error
The Error returned, when trying to
increment
this clock.Source§type WitnessError = Error
type WitnessError = Error
The Error returned, when trying to
witness this
clock.Auto Trait Implementations§
impl !Freeze for PersistedClock
impl RefUnwindSafe for PersistedClock
impl Send for PersistedClock
impl Sync for PersistedClock
impl Unpin for PersistedClock
impl UnwindSafe for PersistedClock
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