pub struct CheckpointSizeMonitor { /* private fields */ }Expand description
Checkpoint size monitor.
Implementations§
Source§impl CheckpointSizeMonitor
impl CheckpointSizeMonitor
Sourcepub const fn with_thresholds(thresholds: SizeThresholds) -> Self
pub const fn with_thresholds(thresholds: SizeThresholds) -> Self
Create a new monitor with custom thresholds.
Sourcepub fn check_size(&self, size_bytes: usize) -> SizeAlert
pub fn check_size(&self, size_bytes: usize) -> SizeAlert
Check checkpoint size and return appropriate alert.
Sourcepub fn check_json(&self, json: &str) -> SizeAlert
pub fn check_json(&self, json: &str) -> SizeAlert
Check serialized JSON size and return an alert.
Sourcepub fn check_json_and_log(&self, json: &str) -> SizeAlert
👎Deprecated since 0.7.3: Use check_json(json) and log at the callsite
pub fn check_json_and_log(&self, json: &str) -> SizeAlert
Use check_json(json) and log at the callsite
Backwards-compatible wrapper.
Library code must not print directly; callers decide how/where to log.
Sourcepub const fn thresholds(&self) -> &SizeThresholds
pub const fn thresholds(&self) -> &SizeThresholds
Get current thresholds.
Trait Implementations§
Source§impl Debug for CheckpointSizeMonitor
impl Debug for CheckpointSizeMonitor
Auto Trait Implementations§
impl Freeze for CheckpointSizeMonitor
impl RefUnwindSafe for CheckpointSizeMonitor
impl Send for CheckpointSizeMonitor
impl Sync for CheckpointSizeMonitor
impl Unpin for CheckpointSizeMonitor
impl UnsafeUnpin for CheckpointSizeMonitor
impl UnwindSafe for CheckpointSizeMonitor
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
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>
Converts
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>
Converts
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