Skip to main content

Laned

Trait Laned 

Source
pub trait Laned:
    Sized
    + Sealed
    + Error
    + Send
    + Sync
    + 'static {
    type WithoutTransient: Error + Send + Sync + 'static;

    // Required methods
    fn lane(&self) -> Lane;
    fn narrow_transient(self, attempts: u32) -> Self::WithoutTransient;
    fn message(&self) -> String;

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

Sealed. The thing retry/record need from any error they are handed: its lane, and how to narrow it. Implemented by every Failure (which covers Fail<D, L> itself and every carrier) and by Fault<L> — the two shapes a generated repo op can return.

Required Associated Types§

Required Methods§

Source

fn lane(&self) -> Lane

Source

fn narrow_transient(self, attempts: u32) -> Self::WithoutTransient

Source

fn message(&self) -> String

The operator-safe one-line text for this failure — exactly what record writes to exception.message, for a boundary that must persist it rather than (or as well as) record it. Transient/ Fatal: the whole source() chain joined with ": ". Denied: its Display. Rejected: the rejection’s code, never its message (display discipline — a rejection’s message may embed caller-supplied input).

Provided Methods§

Source

fn is_transient(&self) -> bool

Source

fn is_fatal(&self) -> bool

Source

fn is_denied(&self) -> bool

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§

Source§

impl<F> Laned for F
where F: Failure, <<F as Failure>::Lanes as LaneProfile>::Transient: NarrowTransient<<<F as Failure>::Lanes as LaneProfile>::Fatal>,

Note the NarrowTransient bound: a profile that admits Transient but not Fatal is not Laned, so retry cannot be handed one. Retrying an operation that claims it can never fail permanently is exactly the contradiction the bound rules out.

Source§

impl<L> Laned for Fault<L>
where L: LaneProfile, <L as LaneProfile>::Transient: NarrowTransient<<L as LaneProfile>::Fatal>,