Struct bonsaidb::local::config::PersistenceThreshold
pub struct PersistenceThreshold {
pub number_of_changes: usize,
pub duration: Duration,
}
Expand description
A threshold controlling lazy commits. For a threshold to apply, both
number_of_changes
must be met or surpassed and duration
must have
elpased since the last commit.
A threshold with a duration of zero will not wait any time to persist
changes once the specified number_of_changes
has been met or surpassed.
Fields§
§number_of_changes: usize
The minimum number of changes that must have occurred for this threshold to apply.
duration: Duration
The amount of time that must elapse since the last write for this threshold to apply.
Implementations§
§impl PersistenceThreshold
impl PersistenceThreshold
pub const fn after_changes(number_of_changes: usize) -> PersistenceThreshold
pub const fn after_changes(number_of_changes: usize) -> PersistenceThreshold
Returns a threshold that applies after a number of changes have elapsed.
pub const fn and_duration(self, duration: Duration) -> PersistenceThreshold
pub const fn and_duration(self, duration: Duration) -> PersistenceThreshold
Sets the duration of this threshold to duration
and returns self.
Trait Implementations§
§impl Clone for PersistenceThreshold
impl Clone for PersistenceThreshold
§fn clone(&self) -> PersistenceThreshold
fn clone(&self) -> PersistenceThreshold
Returns a copy 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 more§impl Debug for PersistenceThreshold
impl Debug for PersistenceThreshold
impl Copy for PersistenceThreshold
Auto Trait Implementations§
impl RefUnwindSafe for PersistenceThreshold
impl Send for PersistenceThreshold
impl Sync for PersistenceThreshold
impl Unpin for PersistenceThreshold
impl UnwindSafe for PersistenceThreshold
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere T: 'a,
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