pub struct BatchResult<T> {
pub status: BatchStatus,
pub order_results: OrderResultMap<T>,
pub summary: BatchSummary,
pub transport_error: Option<EMSError>,
}Expand description
Comprehensive result for batch operations
Fields§
§status: BatchStatusOverall status of the batch operation
order_results: OrderResultMap<T>Individual results for each order
summary: BatchSummarySummary statistics
transport_error: Option<EMSError>Optional transport-level error that affected the entire batch
Implementations§
Source§impl<T> BatchResult<T>
impl<T> BatchResult<T>
Sourcepub fn success(
order_results: OrderResultMap<T>,
processing_time_ns: u64,
) -> Self
pub fn success( order_results: OrderResultMap<T>, processing_time_ns: u64, ) -> Self
Create a new successful batch result
Sourcepub fn partial_success(
order_results: OrderResultMap<T>,
processing_time_ns: u64,
) -> Self
pub fn partial_success( order_results: OrderResultMap<T>, processing_time_ns: u64, ) -> Self
Create a new partial success result
Sourcepub fn all_failed(
order_results: OrderResultMap<T>,
processing_time_ns: u64,
) -> Self
pub fn all_failed( order_results: OrderResultMap<T>, processing_time_ns: u64, ) -> Self
Create a new all-failed result (due to per-order errors)
Sourcepub fn transport_failure(
error: EMSError,
total_orders: usize,
processing_time_ns: u64,
) -> Self
pub fn transport_failure( error: EMSError, total_orders: usize, processing_time_ns: u64, ) -> Self
Create a new transport failure result
Sourcepub const fn has_successes(&self) -> bool
pub const fn has_successes(&self) -> bool
Check if any orders succeeded
Sourcepub const fn has_failures(&self) -> bool
pub const fn has_failures(&self) -> bool
Check if any orders failed
Sourcepub const fn has_retryable_orders(&self) -> bool
pub const fn has_retryable_orders(&self) -> bool
Check if any orders can be retried
Sourcepub fn success_rate(&self) -> f64
pub fn success_rate(&self) -> f64
Get the success rate as a percentage
Sourcepub fn get_retryable_orders(&self) -> SmallVec<[Order; 8]>
pub fn get_retryable_orders(&self) -> SmallVec<[Order; 8]>
Get orders that can be retried
Sourcepub fn get_failures_by_error_type(
&self,
) -> FxHashMap<String, SmallVec<[Order; 4]>>
pub fn get_failures_by_error_type( &self, ) -> FxHashMap<String, SmallVec<[Order; 4]>>
Get failed orders grouped by error type for better error reporting
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§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<T> Freeze for BatchResult<T>
impl<T> !RefUnwindSafe for BatchResult<T>
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>
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