Skip to main content

Failure

Trait Failure 

Source
pub trait Failure:
    Sized
    + Error
    + Send
    + Sync
    + 'static {
    type Rejection: Rejection;
    type Lanes: LaneProfile;

    // Required methods
    fn into_fail(self) -> Fail<Self::Rejection, Self::Lanes>;
    fn from_fail(f: Fail<Self::Rejection, Self::Lanes>) -> Self;
    fn as_fail(&self) -> &Fail<Self::Rejection, Self::Lanes>;

    // Provided methods
    fn lane(&self) -> Lane { ... }
    fn is_transient(&self) -> bool { ... }
}
Expand description

Implemented by per-crate carrier newtypes, typically via #[derive(errlanes::Failure)]. Generic machinery (retry, boundary recorders) is written against this, not against Fail<D, L> directly.

Required Associated Types§

Required Methods§

Source

fn into_fail(self) -> Fail<Self::Rejection, Self::Lanes>

Source

fn from_fail(f: Fail<Self::Rejection, Self::Lanes>) -> Self

Source

fn as_fail(&self) -> &Fail<Self::Rejection, Self::Lanes>

Provided Methods§

Source

fn lane(&self) -> Lane

Source

fn is_transient(&self) -> bool

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<D, L> Failure for Fail<D, L>
where D: Rejection, L: LaneProfile,