pub struct SessionTracker {
pub total_decompressed: Arc<AtomicU64>,
pub files_decompressed: Arc<AtomicUsize>,
pub session_start: Instant,
}Expand description
Session tracker for tracking cumulative decompression across multiple files
Fields§
§total_decompressed: Arc<AtomicU64>Total bytes decompressed in this session
files_decompressed: Arc<AtomicUsize>Number of files decompressed
session_start: InstantSession start time
Implementations§
Source§impl SessionTracker
impl SessionTracker
Sourcepub fn record_decompression(&self, bytes: u64)
pub fn record_decompression(&self, bytes: u64)
Record a successful decompression
Sourcepub fn check_session_limits(&self, limits: &SecurityLimits) -> Result<()>
pub fn check_session_limits(&self, limits: &SecurityLimits) -> Result<()>
Check if session limits are exceeded
Sourcepub fn check_session_limits_with_addition(
&self,
additional_bytes: u64,
limits: &SecurityLimits,
) -> Result<()>
pub fn check_session_limits_with_addition( &self, additional_bytes: u64, limits: &SecurityLimits, ) -> Result<()>
Check if session limits would be exceeded with additional bytes
Trait Implementations§
Source§impl Clone for SessionTracker
impl Clone for SessionTracker
Source§fn clone(&self) -> SessionTracker
fn clone(&self) -> SessionTracker
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 SessionTracker
impl Debug for SessionTracker
Auto Trait Implementations§
impl Freeze for SessionTracker
impl RefUnwindSafe for SessionTracker
impl Send for SessionTracker
impl Sync for SessionTracker
impl Unpin for SessionTracker
impl UnwindSafe for SessionTracker
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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