pub enum BatchOrderError {
TransportError {
error: EMSError,
affected_orders: usize,
is_retryable: bool,
},
PartialFailure {
successful_orders: usize,
failed_orders: usize,
order_results: OrderResultMap,
},
AllOrdersFailed {
total_orders: usize,
order_results: OrderResultMap,
},
EmptyBatch,
BatchSizeExceeded {
actual: usize,
max_allowed: usize,
},
}Expand description
Errors specific to batch order operations
Variants§
TransportError
Transport-level error that affects the entire batch These errors should trigger retry or fallback strategies
Fields
PartialFailure
Per-order errors where some orders succeed and others fail The batch operation partially succeeded
Fields
order_results: OrderResultMapDetailed results for each order
AllOrdersFailed
All orders in the batch failed due to individual order issues No transport-level problems, but all orders had validation/business logic errors
Fields
order_results: OrderResultMapDetailed results for each order
EmptyBatch
Empty batch provided
BatchSizeExceeded
Batch size exceeds exchange limits
Implementations§
Source§impl BatchOrderError
impl BatchOrderError
Sourcepub const fn transport(error: EMSError, affected_orders: usize) -> Self
pub const fn transport(error: EMSError, affected_orders: usize) -> Self
Create a transport error that affects the entire batch
Sourcepub fn partial_failure(order_results: OrderResultMap) -> Self
pub fn partial_failure(order_results: OrderResultMap) -> Self
Create a partial failure error
Sourcepub fn all_failed(order_results: OrderResultMap) -> Self
pub fn all_failed(order_results: OrderResultMap) -> Self
Create an all-orders-failed error
Sourcepub const fn size_exceeded(actual: usize, max_allowed: usize) -> Self
pub const fn size_exceeded(actual: usize, max_allowed: usize) -> Self
Create a batch size exceeded error
Sourcepub fn is_retryable(&self) -> bool
pub fn is_retryable(&self) -> bool
Check if this error suggests the operation might succeed on retry
Sourcepub fn get_retryable_orders(&self) -> SmallVec<[Order; 8]>
pub fn get_retryable_orders(&self) -> SmallVec<[Order; 8]>
Get the orders that can be retried from this error
Sourcepub fn get_error_stats(&self) -> BatchErrorStats
pub fn get_error_stats(&self) -> BatchErrorStats
Get detailed error statistics for monitoring and debugging
Trait Implementations§
Source§impl Clone for BatchOrderError
impl Clone for BatchOrderError
Source§fn clone(&self) -> BatchOrderError
fn clone(&self) -> BatchOrderError
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for BatchOrderError
impl Debug for BatchOrderError
Source§impl Display for BatchOrderError
impl Display for BatchOrderError
Source§impl Error for BatchOrderError
impl Error for BatchOrderError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
Auto Trait Implementations§
impl Freeze for BatchOrderError
impl !RefUnwindSafe for BatchOrderError
impl Send for BatchOrderError
impl Sync for BatchOrderError
impl Unpin for BatchOrderError
impl !UnwindSafe for BatchOrderError
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.