pub trait Laned:
Sized
+ Sealed
+ Error
+ Send
+ Sync
+ 'static {
type WithoutTransient: Error + Send + Sync + 'static;
// Required methods
fn lane(&self) -> Lane;
fn level(&self) -> Level;
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 Fail<D, L>, by
Fault<L> — the two shapes a generated repo op can return — and by every
Carrier whose built-in is Laned.
Required Associated Types§
type WithoutTransient: Error + Send + Sync + 'static
Required Methods§
fn lane(&self) -> Lane
Sourcefn level(&self) -> Level
fn level(&self) -> Level
The operator level of this failure: the lane’s default
(Lane::level), overridden only by a Rejected outcome’s
Rejection::level.
fn narrow_transient(self, attempts: u32) -> Self::WithoutTransient
Sourcefn message(&self) -> String
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§
fn is_transient(&self) -> bool
fn is_fatal(&self) -> bool
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<C> Laned for C
A carrier is Laned exactly when its built-in is, and narrows through it.
Disjoint from the two built-in impls above: Fault / Fail are not
carriers, and downstream cannot implement Carrier for them (orphan rule).
impl<C> Laned for C
A carrier is Laned exactly when its built-in is, and narrows through it.
Disjoint from the two built-in impls above: Fault / Fail are not
carriers, and downstream cannot implement Carrier for them (orphan rule).
type WithoutTransient = <<C as Carrier>::Repr as Laned>::WithoutTransient
Source§impl<D, L> Laned for Fail<D, L>where
D: Rejection,
L: LaneProfile,
<L as LaneProfile>::Transient: NarrowTransient<<L 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.
impl<D, L> Laned for Fail<D, L>where
D: Rejection,
L: LaneProfile,
<L as LaneProfile>::Transient: NarrowTransient<<L 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.