pub struct PruneLimiter { /* private fields */ }
Expand description
Limits a pruner run by either the number of entries (rows in the database) that can be deleted or the time it can run.
Implementations§
Source§impl PruneLimiter
impl PruneLimiter
Sourcepub fn set_deleted_entries_limit(self, limit: usize) -> Self
pub fn set_deleted_entries_limit(self, limit: usize) -> Self
Sets the limit on the number of deleted entries (rows in the database). If the limit was already set, it will be overwritten.
Sourcepub fn floor_deleted_entries_limit_to_multiple_of(
self,
denominator: NonZeroUsize,
) -> Self
pub fn floor_deleted_entries_limit_to_multiple_of( self, denominator: NonZeroUsize, ) -> Self
Sets the limit on the number of deleted entries (rows in the database) to a biggest multiple of the given denominator that is smaller than the existing limit.
If the limit wasn’t set, does nothing.
Sourcepub fn is_deleted_entries_limit_reached(&self) -> bool
pub fn is_deleted_entries_limit_reached(&self) -> bool
Returns true
if the limit on the number of deleted entries (rows in the database) is
reached.
Sourcepub fn increment_deleted_entries_count_by(&mut self, entries: usize)
pub fn increment_deleted_entries_count_by(&mut self, entries: usize)
Increments the number of deleted entries by the given number.
Sourcepub fn increment_deleted_entries_count(&mut self)
pub fn increment_deleted_entries_count(&mut self)
Increments the number of deleted entries by one.
Sourcepub fn deleted_entries_limit_left(&self) -> Option<usize>
pub fn deleted_entries_limit_left(&self) -> Option<usize>
Returns the number of deleted entries left before the limit is reached.
Sourcepub fn deleted_entries_limit(&self) -> Option<usize>
pub fn deleted_entries_limit(&self) -> Option<usize>
Returns the limit on the number of deleted entries (rows in the database).
Sourcepub fn set_time_limit(self, limit: Duration) -> Self
pub fn set_time_limit(self, limit: Duration) -> Self
Sets the time limit.
Sourcepub fn is_time_limit_reached(&self) -> bool
pub fn is_time_limit_reached(&self) -> bool
Returns true
if time limit is reached.
Sourcepub fn is_limit_reached(&self) -> bool
pub fn is_limit_reached(&self) -> bool
Returns true
if any limit is reached.
Trait Implementations§
Source§impl Clone for PruneLimiter
impl Clone for PruneLimiter
Source§fn clone(&self) -> PruneLimiter
fn clone(&self) -> PruneLimiter
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for PruneLimiter
impl Debug for PruneLimiter
Source§impl Default for PruneLimiter
impl Default for PruneLimiter
Source§fn default() -> PruneLimiter
fn default() -> PruneLimiter
Auto Trait Implementations§
impl Freeze for PruneLimiter
impl RefUnwindSafe for PruneLimiter
impl Send for PruneLimiter
impl Sync for PruneLimiter
impl Unpin for PruneLimiter
impl UnwindSafe for PruneLimiter
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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 more§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 56 bytes