Struct BatchError

Source
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>

Source

pub fn no_retry(_: impl Error + Send + Sync + 'static) -> Self

An error that can’t be retried.

Source

pub fn retry(_: impl Error + Send + Sync + 'static, retryable: T) -> Self

An error that can be retried.

Source

pub fn try_into_retryable(self) -> Result<T, BatchError<T>>

Try convert the error into a retryable value.

Source

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.

Source

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.