Struct checkpoint::wrappers::GuardWrapper
[−]
[src]
pub struct GuardWrapper<T> { /* fields omitted */ }
Protects checkpoint data by ensuring that no two uncommitted checkpoints can have the same
identifier and that committed checkpoints cannot be removed while in use (i.e. have a binding
created by either the commit_checkpoint
method or the load_checkpoint
method).
Protection is limited to interactions with a single GuardWrapper
object directly.
For example, if multiple guarded FileStorage
objects
are opened with the same path, it is possible for one of them to remove a checkpoint even if
the others have the same checkpoint marked as in-use.
Furthermore, GuardWrapper
objects offer no protection against outside processes which may be
operating on the underlying storage medium.
Methods
impl<T: Storage> GuardWrapper<T>
[src]
Trait Implementations
impl<T: Debug> Debug for GuardWrapper<T>
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl<T: Storage> Storage for GuardWrapper<T>
[src]
type Committed = Committed<T::Committed>
The type representing committed checkpoints.
type Uncommitted = Uncommitted<T::Uncommitted>
The type representing uncommitted checkpoints.
fn create_checkpoint(
&mut self,
identifier: &str
) -> Result<Self::Uncommitted, Error>
[src]
&mut self,
identifier: &str
) -> Result<Self::Uncommitted, Error>
Creates a new checkpoint with the specified identifier. Read more
fn commit_checkpoint(
&mut self,
uncommitted: Self::Uncommitted
) -> Result<Self::Committed, Error>
[src]
&mut self,
uncommitted: Self::Uncommitted
) -> Result<Self::Committed, Error>
Commits an uncommitted checkpoint, permanently saving its data to the underlying storage medium. Read more
fn load_checkpoint(
&mut self,
identifier: &str
) -> Result<Self::Committed, Error>
[src]
&mut self,
identifier: &str
) -> Result<Self::Committed, Error>
Loads the committed checkpoint associated with the provided identifier, allowing its data to be retrieved. Read more
fn remove_checkpoint(&mut self, identifier: &str) -> Result<(), Error>
[src]
Removes the committed checkpoint associated with the provided identifier. Read more
fn checkpoint_identifiers(&mut self) -> Result<Vec<String>, Error>
[src]
Returns a list of all committed checkpoint identifiers in the underlying storage medium.
Auto Trait Implementations
impl<T> Send for GuardWrapper<T> where
T: Send,
T: Send,
impl<T> Sync for GuardWrapper<T> where
T: Sync,
T: Sync,