pub struct ResilienceManager { /* private fields */ }
Expand description
Comprehensive resilience manager
Implementations§
Source§impl ResilienceManager
impl ResilienceManager
Sourcepub fn new(
retry_config: RetryConfig,
circuit_config: CircuitBreakerConfig,
) -> Self
pub fn new( retry_config: RetryConfig, circuit_config: CircuitBreakerConfig, ) -> Self
Create a new resilience manager
Sourcepub async fn execute<F, Fut, T>(&self, operation: F) -> Result<T>
pub async fn execute<F, Fut, T>(&self, operation: F) -> Result<T>
Execute an operation with full resilience (circuit breaker + retry)
Sourcepub async fn execute_with_fallback<F, Fut, T, FB, FutB>(
&self,
operation: F,
fallback: FB,
) -> T
pub async fn execute_with_fallback<F, Fut, T, FB, FutB>( &self, operation: F, fallback: FB, ) -> T
Execute with graceful degradation - returns partial results on failure
Sourcepub fn circuit_state(&self) -> CircuitState
pub fn circuit_state(&self) -> CircuitState
Get circuit breaker state
Sourcepub fn is_healthy(&self) -> bool
pub fn is_healthy(&self) -> bool
Check if the circuit is healthy
Trait Implementations§
Source§impl Default for ResilienceManager
impl Default for ResilienceManager
Source§fn default() -> ResilienceManager
fn default() -> ResilienceManager
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ResilienceManager
impl RefUnwindSafe for ResilienceManager
impl Send for ResilienceManager
impl Sync for ResilienceManager
impl Unpin for ResilienceManager
impl UnwindSafe for ResilienceManager
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
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