pub enum Admission<'b> {
Proceed(BreakerState, TrialGuard<'b>),
ShortCircuit,
}Expand description
Whether the breaker admits a pull-through attempt right now.
A Proceed carries a TrialGuard that owns any HALF-OPEN trial
slot reserved by OriginBreaker::acquire. The guard MUST be kept
alive across the (possibly-cancelled) origin fetch and then resolved
with TrialGuard::record; if it is dropped without record — the
case when the surrounding future is cancelled mid-await — its Drop
releases the reserved slot so a stuck breaker can never leak its
half-open budget. See TrialGuard.
Variants§
Proceed(BreakerState, TrialGuard<'b>)
Proceed with the (retry-looped) origin fetch. Carries the state
the breaker was in at admission so the caller knows whether this
is a normal CLOSED request or a HALF-OPEN trial (only for
logging — record handles the transition either way), plus the
TrialGuard that releases the trial slot on cancellation.
ShortCircuit
Short-circuit: the breaker is OPEN (or HALF-OPEN with its trial budget exhausted). The caller must fast-fail this miss WITHOUT running the retry/backoff loop.
Trait Implementations§
Auto Trait Implementations§
impl<'b> !RefUnwindSafe for Admission<'b>
impl<'b> !UnwindSafe for Admission<'b>
impl<'b> Freeze for Admission<'b>
impl<'b> Send for Admission<'b>
impl<'b> Sync for Admission<'b>
impl<'b> Unpin for Admission<'b>
impl<'b> UnsafeUnpin for Admission<'b>
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more