pub struct BatchError<T> { /* private fields */ }Expand description
An error encountered processing a batch.
The error may contain part of the batch to retry.
Implementations§
Source§impl<T> BatchError<T>
impl<T> BatchError<T>
Sourcepub fn retry(_: impl Error + Send + Sync + 'static, retryable: T) -> Self
pub fn retry(_: impl Error + Send + Sync + 'static, retryable: T) -> Self
An error that can be retried.
Sourcepub fn try_into_retryable(self) -> Result<T, BatchError<T>>
pub fn try_into_retryable(self) -> Result<T, BatchError<T>>
Try convert the error into a retryable value.
Sourcepub fn into_retryable(self) -> Option<T>
pub fn into_retryable(self) -> Option<T>
Try get the retryable batch from the error.
If the error is not retryable then this method will return None.
Sourcepub fn map_retryable<U>(
self,
f: impl FnOnce(Option<T>) -> Option<U>,
) -> BatchError<U>
pub fn map_retryable<U>( self, f: impl FnOnce(Option<T>) -> Option<U>, ) -> BatchError<U>
Map the retryable batch.
If the batch is already retryable, the input to f will be Some. The resulting batch is retryable if f returns Some.
Auto Trait Implementations§
impl<T> Freeze for BatchError<T>where
T: Freeze,
impl<T> RefUnwindSafe for BatchError<T>where
T: RefUnwindSafe,
impl<T> Send for BatchError<T>where
T: Send,
impl<T> Sync for BatchError<T>where
T: Sync,
impl<T> Unpin for BatchError<T>where
T: Unpin,
impl<T> UnwindSafe for BatchError<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