pub struct BatchResults<T> {
pub results: Vec<FileResult<T>>,
pub elapsed_ms: u128,
}Expand description
Aggregated results from a batch processing operation.
Contains all individual file results and provides statistics.
§Type Parameters
T- The success type returned by the operation
Fields§
§results: Vec<FileResult<T>>Individual results for each processed file
elapsed_ms: u128Total processing time in milliseconds
Implementations§
Source§impl<T> BatchResults<T>
impl<T> BatchResults<T>
Sourcepub fn new(results: Vec<FileResult<T>>, elapsed_ms: u128) -> Self
pub fn new(results: Vec<FileResult<T>>, elapsed_ms: u128) -> Self
Create new batch results from a vector of file results.
Sourcepub fn total_files(&self) -> usize
pub fn total_files(&self) -> usize
Get the total number of files processed.
Sourcepub fn success_count(&self) -> usize
pub fn success_count(&self) -> usize
Get the number of successfully processed files.
Sourcepub fn failure_count(&self) -> usize
pub fn failure_count(&self) -> usize
Get the number of failed files.
Sourcepub fn all_succeeded(&self) -> bool
pub fn all_succeeded(&self) -> bool
Check if all files were processed successfully.
Sourcepub fn has_failures(&self) -> bool
pub fn has_failures(&self) -> bool
Check if any files failed.
Sourcepub fn successes(&self) -> impl Iterator<Item = &FileResult<T>>
pub fn successes(&self) -> impl Iterator<Item = &FileResult<T>>
Get an iterator over successful results.
Sourcepub fn failures(&self) -> impl Iterator<Item = &FileResult<T>>
pub fn failures(&self) -> impl Iterator<Item = &FileResult<T>>
Get an iterator over failed results.
Sourcepub fn throughput(&self) -> f64
pub fn throughput(&self) -> f64
Get processing throughput in files per second.
Trait Implementations§
Source§impl<T: Clone> Clone for BatchResults<T>
impl<T: Clone> Clone for BatchResults<T>
Source§fn clone(&self) -> BatchResults<T>
fn clone(&self) -> BatchResults<T>
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 moreAuto Trait Implementations§
impl<T> Freeze for BatchResults<T>
impl<T> RefUnwindSafe for BatchResults<T>where
T: RefUnwindSafe,
impl<T> Send for BatchResults<T>where
T: Send,
impl<T> Sync for BatchResults<T>where
T: Sync,
impl<T> Unpin for BatchResults<T>where
T: Unpin,
impl<T> UnwindSafe for BatchResults<T>where
T: UnwindSafe,
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