pub struct CheckpointPolicy {
pub every_n_records: u64,
pub on_shutdown: bool,
pub explicit_only: bool,
}Expand description
Policy for when to create checkpoints.
Checkpoints bound the worst-case verification cost. The default policy creates a checkpoint every 1000 records and on graceful shutdown.
Fields§
§every_n_records: u64Create a checkpoint every N records. Set to 0 to disable.
on_shutdown: boolCreate a checkpoint on graceful shutdown.
explicit_only: boolIf true, disable automatic checkpoints (only explicit calls).
Implementations§
Source§impl CheckpointPolicy
impl CheckpointPolicy
Sourcepub fn explicit_only() -> Self
pub fn explicit_only() -> Self
Creates a policy that only creates explicit checkpoints.
Sourcepub fn should_checkpoint(&self, offset: Offset) -> bool
pub fn should_checkpoint(&self, offset: Offset) -> bool
Returns true if a checkpoint should be created at this offset.
Trait Implementations§
Source§impl Clone for CheckpointPolicy
impl Clone for CheckpointPolicy
Source§fn clone(&self) -> CheckpointPolicy
fn clone(&self) -> CheckpointPolicy
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 Debug for CheckpointPolicy
impl Debug for CheckpointPolicy
Source§impl Default for CheckpointPolicy
impl Default for CheckpointPolicy
Source§impl<'de> Deserialize<'de> for CheckpointPolicy
impl<'de> Deserialize<'de> for CheckpointPolicy
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Hash for CheckpointPolicy
impl Hash for CheckpointPolicy
Source§impl PartialEq for CheckpointPolicy
impl PartialEq for CheckpointPolicy
Source§impl Serialize for CheckpointPolicy
impl Serialize for CheckpointPolicy
impl Copy for CheckpointPolicy
impl Eq for CheckpointPolicy
impl StructuralPartialEq for CheckpointPolicy
Auto Trait Implementations§
impl Freeze for CheckpointPolicy
impl RefUnwindSafe for CheckpointPolicy
impl Send for CheckpointPolicy
impl Sync for CheckpointPolicy
impl Unpin for CheckpointPolicy
impl UnwindSafe for CheckpointPolicy
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