pub struct BtmCfg {
pub enable: bool,
pub itv: u64,
pub cap: u64,
pub cap_clean_kept: usize,
pub mode: SnapMode,
pub algo: SnapAlgo,
pub volume: String,
}Expand description
Config structure of snapshot
Fields
enable: boola global switch for enabling snapshot functions
itv: u64interval between adjacent snapshots, default to 10 blocks
cap: u64the maximum number of snapshots that will be stored, default to 100
cap_clean_kept: usizehow many snapshots should be kept after a clean_snapshots
mode: SnapModeZfs or Btrfs or External, will try a guess if missing
algo: SnapAlgoFair or Fade, default to ‘Fair’
volume: Stringa data volume containing both ledger data and tendermint data
Implementations
sourceimpl BtmCfg
impl BtmCfg
sourcepub fn new_client_hdr() -> Self
pub fn new_client_hdr() -> Self
Used in client side
sourcepub fn snapshot(&self, idx: u64) -> Result<()>
pub fn snapshot(&self, idx: u64) -> Result<()>
generate a snapshot for the latest state of blockchain
sourcepub fn rollback(&self, idx: Option<u64>, strict: bool) -> Result<()>
pub fn rollback(&self, idx: Option<u64>, strict: bool) -> Result<()>
rollback the state of blockchain to a specificed height
sourcepub fn get_sorted_snapshots(&self) -> Result<Vec<u64>>
pub fn get_sorted_snapshots(&self) -> Result<Vec<u64>>
Get snapshot list in ‘DESC’ order.
sourcepub fn guess_mode(volume: &str) -> Result<SnapMode>
pub fn guess_mode(volume: &str) -> Result<SnapMode>
try to guess a correct mode
NOTE: not suitable for External mode
sourcepub fn list_snapshots(&self) -> Result<()>
pub fn list_snapshots(&self) -> Result<()>
List all existing snapshots.
sourcepub fn clean_snapshots(&self) -> Result<()>
pub fn clean_snapshots(&self) -> Result<()>
Clean all existing snapshots.
Trait Implementations
sourceimpl CommandFactory for BtmCfg
impl CommandFactory for BtmCfg
sourcefn into_app_for_update<'b>() -> Command<'b>
fn into_app_for_update<'b>() -> Command<'b>
Deprecated, replaced with
CommandFactory::command_for_updatesourcefn command_for_update<'help>() -> App<'help>
fn command_for_update<'help>() -> App<'help>
sourceimpl FromArgMatches for BtmCfg
impl FromArgMatches for BtmCfg
sourcefn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
sourcefn 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>
sourcefn 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.sourcefn 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.sourceimpl Parser for BtmCfg
impl Parser for BtmCfg
sourcefn parse_from<I, T>(itr: I) -> Selfwhere
I: IntoIterator<Item = T>,
T: Into<OsString> + Clone,
fn parse_from<I, T>(itr: I) -> Selfwhere
I: IntoIterator<Item = T>,
T: Into<OsString> + Clone,
Parse from iterator, exit on error
sourcefn try_parse_from<I, T>(itr: I) -> Result<Self, Error>where
I: IntoIterator<Item = T>,
T: Into<OsString> + Clone,
fn try_parse_from<I, T>(itr: I) -> Result<Self, Error>where
I: IntoIterator<Item = T>,
T: Into<OsString> + Clone,
Parse from iterator, return Err on error.
sourcefn update_from<I, T>(&mut self, itr: I)where
I: IntoIterator<Item = T>,
T: Into<OsString> + Clone,
fn update_from<I, T>(&mut self, itr: I)where
I: IntoIterator<Item = T>,
T: Into<OsString> + Clone,
Update from iterator, exit on error
sourcefn try_update_from<I, T>(&mut self, itr: I) -> Result<(), Error>where
I: IntoIterator<Item = T>,
T: Into<OsString> + Clone,
fn try_update_from<I, T>(&mut self, itr: I) -> Result<(), Error>where
I: IntoIterator<Item = T>,
T: Into<OsString> + Clone,
Update from iterator, return Err on error.
Auto Trait Implementations
impl RefUnwindSafe for BtmCfg
impl Send for BtmCfg
impl Sync for BtmCfg
impl Unpin for BtmCfg
impl UnwindSafe for BtmCfg
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more