Skip to main content

Classify

Trait Classify 

Source
pub trait Classify:
    Error
    + Send
    + Sync
    + 'static {
    type Rejected: RejectedSlot;
    type Lanes: LaneProfile;

    // Required method
    fn classify(self) -> Fail<Self::Rejected, Self::Lanes>;
}
Expand description

How a local error enters the lanes: which part is a typed domain outcome that a caller can correct, and which fault lanes the rest can take.

A pure Rejection gets this for free (the blanket below): all of it is rejected, no lanes. A fault wrapper or a mixed wrapper implements it directly, by hand or via #[derive(errlanes::Classify)]. A type is one or the other, never both — Rejection and a direct Classify impl on the same type conflict (E0119).

Required Associated Types§

Required Methods§

Source

fn classify(self) -> Fail<Self::Rejected, Self::Lanes>

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§

Source§

impl<R: Rejection> Classify for R

A Rejection is the special case of Classify: all of it is rejected, no lanes.

Source§

type Rejected = R

Source§

type Lanes = Profile<false, false, false>