pub struct RiAdvancedCircuitBreaker { /* private fields */ }Expand description
Advanced circuit breaker with separate failure thresholds for different error types.
This struct extends the basic circuit breaker functionality by maintaining separate statistics for different error types, allowing for more granular control over circuit breaker behavior.
Implementations§
Source§impl RiAdvancedCircuitBreaker
impl RiAdvancedCircuitBreaker
Sourcepub fn new(config: RiCircuitBreakerConfig) -> Self
pub fn new(config: RiCircuitBreakerConfig) -> Self
Sourcepub async fn record_success_with_type(&self, error_type: Option<&str>)
pub async fn record_success_with_type(&self, error_type: Option<&str>)
Records a successful operation for a specific error type and updates the circuit breaker state if necessary.
§Parameters
error_type: The error type identifier, orNonefor default statistics
Sourcepub async fn record_failure_with_type(&self, error_type: Option<&str>)
pub async fn record_failure_with_type(&self, error_type: Option<&str>)
Records a failed operation for a specific error type and updates the circuit breaker state if necessary.
§Parameters
error_type: The error type identifier, orNonefor default statistics
Sourcepub async fn allow_request_for_type(&self, error_type: Option<&str>) -> bool
pub async fn allow_request_for_type(&self, error_type: Option<&str>) -> bool
Auto Trait Implementations§
impl !Freeze for RiAdvancedCircuitBreaker
impl !RefUnwindSafe for RiAdvancedCircuitBreaker
impl Send for RiAdvancedCircuitBreaker
impl Sync for RiAdvancedCircuitBreaker
impl Unpin for RiAdvancedCircuitBreaker
impl UnsafeUnpin for RiAdvancedCircuitBreaker
impl !UnwindSafe for RiAdvancedCircuitBreaker
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::RequestSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request