pub struct FileStatsCollector { /* private fields */ }Expand description
Collects file-level statistics from existing metadata (doc entries).
Does not scan the filesystem — entries are fed via [add_entry].
Implementations§
Source§impl FileStatsCollector
impl FileStatsCollector
pub fn new() -> Self
Sourcepub fn add_entry_bytes(&mut self, key: &[u8], size: u64)
pub fn add_entry_bytes(&mut self, key: &[u8], size: u64)
Attempt to record an entry key stored as raw bytes (UTF-8). Non-UTF-8 keys are silently skipped.
Sourcepub fn add_entry_with_time(
&mut self,
path: &str,
size: u64,
timestamp_micros: Option<u64>,
)
pub fn add_entry_with_time( &mut self, path: &str, size: u64, timestamp_micros: Option<u64>, )
Record one file entry with its insertion timestamp (microseconds since Unix epoch).
Sourcepub fn add_entry_bytes_with_time(
&mut self,
key: &[u8],
size: u64,
timestamp_micros: Option<u64>,
)
pub fn add_entry_bytes_with_time( &mut self, key: &[u8], size: u64, timestamp_micros: Option<u64>, )
UTF-8 bytes variant of [add_entry_with_time].
Non-UTF-8 keys are silently skipped and no timestamp is recorded.
Sourcepub fn report(&self) -> FileStatsReport
pub fn report(&self) -> FileStatsReport
Finalise and return the collected report.
Trait Implementations§
Source§impl Clone for FileStatsCollector
impl Clone for FileStatsCollector
Source§fn clone(&self) -> FileStatsCollector
fn clone(&self) -> FileStatsCollector
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 FileStatsCollector
impl Debug for FileStatsCollector
Source§impl Default for FileStatsCollector
impl Default for FileStatsCollector
Source§fn default() -> FileStatsCollector
fn default() -> FileStatsCollector
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for FileStatsCollector
impl RefUnwindSafe for FileStatsCollector
impl Send for FileStatsCollector
impl Sync for FileStatsCollector
impl Unpin for FileStatsCollector
impl UnsafeUnpin for FileStatsCollector
impl UnwindSafe for FileStatsCollector
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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> ⓘ
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