pub struct BtmCfg {
pub itv: u64,
pub cap: u64,
pub cap_clean_kept: usize,
pub mode: SnapMode,
pub algo: SnapAlgo,
pub volume: String,
}
Expand description
Configures of snapshot mgmt
Fields§
§itv: u64
The interval between adjacent snapshots, default to 10 blocks
cap: u64
The maximum number of snapshots that will be stored, default to 100
cap_clean_kept: usize
How many snapshots should be kept after a clean_snapshots
, default to 0
mode: SnapMode
Zfs or Btrfs or External, should try a guess if missing
algo: SnapAlgo
Fair or Fade, default to ‘Fair’
volume: String
A data volume containing all blockchain data
Implementations§
source§impl BtmCfg
impl BtmCfg
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<i128>, strict: bool) -> Result<()>
pub fn rollback(&self, idx: Option<i128>, 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 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§
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§
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