pub struct CircuitBreakerRef { /* private fields */ }Expand description
Reference to a domain’s circuit breaker.
Implementations§
Source§impl CircuitBreakerRef
impl CircuitBreakerRef
Sourcepub fn is_allowed(&self) -> bool
pub fn is_allowed(&self) -> bool
Check if request is allowed.
Sourcepub fn record_success(&self)
pub fn record_success(&self)
Record success.
Sourcepub fn record_failure(&self)
pub fn record_failure(&self)
Record failure.
Sourcepub fn state(&self) -> CircuitState
pub fn state(&self) -> CircuitState
Get current state.
Sourcepub fn failure_count(&self) -> u32
pub fn failure_count(&self) -> u32
Get failure count.
Auto Trait Implementations§
impl Freeze for CircuitBreakerRef
impl RefUnwindSafe for CircuitBreakerRef
impl Send for CircuitBreakerRef
impl Sync for CircuitBreakerRef
impl Unpin for CircuitBreakerRef
impl UnsafeUnpin for CircuitBreakerRef
impl UnwindSafe for CircuitBreakerRef
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
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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>
Converts
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>
Converts
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