pub struct BatchResult<T> {
pub successful: Vec<T>,
pub failed: Vec<(T, String)>,
pub total: usize,
}Expand description
Result of a batch operation
Fields§
§successful: Vec<T>Successfully processed items
failed: Vec<(T, String)>Failed items with their errors
total: usizeTotal number of items processed
Implementations§
Source§impl<T> BatchResult<T>
impl<T> BatchResult<T>
Sourcepub fn is_success(&self) -> bool
pub fn is_success(&self) -> bool
Check if all operations succeeded
Sourcepub fn success_rate(&self) -> f64
pub fn success_rate(&self) -> f64
Get success rate (0.0 to 1.0)
Sourcepub fn success_count(&self) -> usize
pub fn success_count(&self) -> usize
Get number of successful operations
Sourcepub fn failure_count(&self) -> usize
pub fn failure_count(&self) -> usize
Get number of failed operations
Trait Implementations§
Source§impl<T: Clone> Clone for BatchResult<T>
impl<T: Clone> Clone for BatchResult<T>
Source§fn clone(&self) -> BatchResult<T>
fn clone(&self) -> BatchResult<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 moreSource§impl<T: Debug> Debug for BatchResult<T>
impl<T: Debug> Debug for BatchResult<T>
Auto Trait Implementations§
impl<T> Freeze for BatchResult<T>
impl<T> RefUnwindSafe for BatchResult<T>where
T: RefUnwindSafe,
impl<T> Send for BatchResult<T>where
T: Send,
impl<T> Sync for BatchResult<T>where
T: Sync,
impl<T> Unpin for BatchResult<T>where
T: Unpin,
impl<T> UnwindSafe for BatchResult<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> 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