pub struct BatchResult<T> {
pub successes: Vec<(usize, T)>,
pub failures: Vec<(usize, Error)>,
}Expand description
Result of a batch operation
Fields§
§successes: Vec<(usize, T)>Successful operations with their results
failures: Vec<(usize, Error)>Failed operations with their errors
Implementations§
Source§impl<T> BatchResult<T>
impl<T> BatchResult<T>
Sourcepub fn add_success(&mut self, index: usize, result: T)
pub fn add_success(&mut self, index: usize, result: T)
Add a successful result
Sourcepub fn add_failure(&mut self, index: usize, error: Error)
pub fn add_failure(&mut self, index: usize, error: Error)
Add a failed result
Sourcepub fn success_rate(&self) -> f64
pub fn success_rate(&self) -> f64
Get success rate as a percentage
Sourcepub fn all_succeeded(&self) -> bool
pub fn all_succeeded(&self) -> bool
Check if all operations succeeded
Sourcepub fn total_operations(&self) -> usize
pub fn total_operations(&self) -> usize
Get total number of 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