pub struct CheckpointDb { /* private fields */ }Implementations§
Source§impl CheckpointDb
impl CheckpointDb
Source§impl CheckpointDb
impl CheckpointDb
Sourcepub fn restore<T: Checkpoint>(&self, data: &mut T) -> Result<bool>
pub fn restore<T: Checkpoint>(&self, data: &mut T) -> Result<bool>
Restore chain from checkpoint. Return true if restored successfuly,
false otherwise.
Sourcepub fn restored<T: Checkpoint>(&self) -> Result<T>
👎Deprecated: Please use load_from_latest instead
pub fn restored<T: Checkpoint>(&self) -> Result<T>
Return checkpointed T
Sourcepub fn load_from_latest<T: Checkpoint>(&self) -> Result<T>
pub fn load_from_latest<T: Checkpoint>(&self) -> Result<T>
Load latest struct T from checkpoint
Sourcepub fn load_from_slot_n<T: Checkpoint>(&self, slot: i32) -> Result<T>
pub fn load_from_slot_n<T: Checkpoint>(&self, slot: i32) -> Result<T>
Load struct T from checkpoint in slot
Sourcepub fn commit<T: Checkpoint>(&self, data: &T) -> Result<bool>
pub fn commit<T: Checkpoint>(&self, data: &T) -> Result<bool>
Commit a checkpoint into database. Return true if committed, false otherwise.
Sourcepub fn get_number_of_checkpoints<T: Checkpoint>(&self) -> Result<u64>
pub fn get_number_of_checkpoints<T: Checkpoint>(&self) -> Result<u64>
Return the number of available checkpoints in database.
Trait Implementations§
Source§impl Args for CheckpointDb
impl Args for CheckpointDb
Source§fn augment_args<'b>(__clap_app: Command) -> Command
fn augment_args<'b>(__clap_app: Command) -> Command
Source§fn augment_args_for_update<'b>(__clap_app: Command) -> Command
fn augment_args_for_update<'b>(__clap_app: Command) -> Command
Append to
Command so it can instantiate self via
FromArgMatches::update_from_arg_matches_mut Read moreSource§impl Clone for CheckpointDb
impl Clone for CheckpointDb
Source§fn clone(&self) -> CheckpointDb
fn clone(&self) -> CheckpointDb
Returns a duplicate 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 moreSource§impl CommandFactory for CheckpointDb
impl CommandFactory for CheckpointDb
Source§impl Debug for CheckpointDb
impl Debug for CheckpointDb
Source§impl Default for CheckpointDb
impl Default for CheckpointDb
Source§fn default() -> CheckpointDb
fn default() -> CheckpointDb
Returns the “default value” for a type. Read more
Source§impl FromArgMatches for CheckpointDb
impl FromArgMatches for CheckpointDb
Source§fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
Source§fn from_arg_matches_mut(
__clap_arg_matches: &mut ArgMatches,
) -> Result<Self, Error>
fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>
Source§fn update_from_arg_matches(
&mut self,
__clap_arg_matches: &ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>
Assign values from
ArgMatches to self.Source§fn update_from_arg_matches_mut(
&mut self,
__clap_arg_matches: &mut ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches_mut( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>
Assign values from
ArgMatches to self.Source§impl Parser for CheckpointDb
impl Parser for CheckpointDb
Source§fn parse_from<I, T>(itr: I) -> Self
fn parse_from<I, T>(itr: I) -> Self
Parse from iterator, exit on error.
Source§fn try_parse_from<I, T>(itr: I) -> Result<Self, Error>
fn try_parse_from<I, T>(itr: I) -> Result<Self, Error>
Parse from iterator, return Err on error.
Source§fn update_from<I, T>(&mut self, itr: I)
fn update_from<I, T>(&mut self, itr: I)
Auto Trait Implementations§
impl Freeze for CheckpointDb
impl RefUnwindSafe for CheckpointDb
impl Send for CheckpointDb
impl Sync for CheckpointDb
impl Unpin for CheckpointDb
impl UnwindSafe for CheckpointDb
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoSql for T
impl<T> IntoSql for T
Source§fn into_sql<T>(self) -> Self::Expressionwhere
Self: Sized + AsExpression<T>,
fn into_sql<T>(self) -> Self::Expressionwhere
Self: Sized + AsExpression<T>,
Convert
self to an expression for Diesel’s query builder. Read moreSource§fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expressionwhere
&'a Self: AsExpression<T>,
fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expressionwhere
&'a Self: AsExpression<T>,
Convert
&self to an expression for Diesel’s query builder. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.