pub struct LifeloopFailureMapper;Expand description
Concrete FailureMapper for issue #15.
Stateless and zero-sized — instances exist only so the type participates in trait dispatch.
Implementations§
Source§impl LifeloopFailureMapper
impl LifeloopFailureMapper
pub fn new() -> Self
Sourcepub fn map_receipt_error(
&self,
err: &ReceiptError,
) -> (FailureClass, RetryClass)
pub fn map_receipt_error( &self, err: &ReceiptError, ) -> (FailureClass, RetryClass)
Convenience: map a ReceiptError to the (failure, retry)
pair a failed receipt would carry.
Sourcepub fn map_transport_error(
&self,
err: &TransportError,
) -> (FailureClass, RetryClass)
pub fn map_transport_error( &self, err: &TransportError, ) -> (FailureClass, RetryClass)
Convenience: map a TransportError to the (failure, retry)
pair a failed receipt would carry.
Sourcepub fn map_unknown_error(&self, _err: &dyn Error) -> (FailureClass, RetryClass)
pub fn map_unknown_error(&self, _err: &dyn Error) -> (FailureClass, RetryClass)
Convenience: map a generic dyn std::error::Error to a
(InternalError, RetryAfterReread) pair. Used when the only
thing the caller has is a boxed error.
Trait Implementations§
Source§impl Clone for LifeloopFailureMapper
impl Clone for LifeloopFailureMapper
Source§fn clone(&self) -> LifeloopFailureMapper
fn clone(&self) -> LifeloopFailureMapper
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for LifeloopFailureMapper
impl Debug for LifeloopFailureMapper
Source§impl Default for LifeloopFailureMapper
impl Default for LifeloopFailureMapper
Source§fn default() -> LifeloopFailureMapper
fn default() -> LifeloopFailureMapper
Returns the “default value” for a type. Read more
Source§impl FailureMapper for LifeloopFailureMapper
impl FailureMapper for LifeloopFailureMapper
Source§fn map_route_error(&self, err: &RouteError) -> (FailureClass, RetryClass)
fn map_route_error(&self, err: &RouteError) -> (FailureClass, RetryClass)
Map a
RouteError to a (failure_class, retry_class)
pair. Implementations must be deterministic — the same
RouteError variant must always map to the same pair so
receipt ledgers replay consistently.impl Copy for LifeloopFailureMapper
Auto Trait Implementations§
impl Freeze for LifeloopFailureMapper
impl RefUnwindSafe for LifeloopFailureMapper
impl Send for LifeloopFailureMapper
impl Sync for LifeloopFailureMapper
impl Unpin for LifeloopFailureMapper
impl UnsafeUnpin for LifeloopFailureMapper
impl UnwindSafe for LifeloopFailureMapper
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