pub struct RecoveryStrategy { /* private fields */ }Expand description
Comprehensive recovery strategy system
Implementations§
Source§impl RecoveryStrategy
impl RecoveryStrategy
Sourcepub fn recover(&mut self, error: &MemScopeError) -> RecoveryResult
pub fn recover(&mut self, error: &MemScopeError) -> RecoveryResult
Execute recovery action for given error
Sourcepub fn register_action(&mut self, kind: ErrorKind, action: RecoveryAction)
pub fn register_action(&mut self, kind: ErrorKind, action: RecoveryAction)
Register custom recovery action for error kind
Sourcepub fn register_fallback<F>(&mut self, name: String, strategy: F)
pub fn register_fallback<F>(&mut self, name: String, strategy: F)
Register fallback strategy
Sourcepub fn get_circuit_status(&self) -> CircuitState
pub fn get_circuit_status(&self) -> CircuitState
Get circuit breaker status
Sourcepub fn reset_circuit(&mut self)
pub fn reset_circuit(&mut self)
Force circuit breaker to reset
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RecoveryStrategy
impl !RefUnwindSafe for RecoveryStrategy
impl Send for RecoveryStrategy
impl Sync for RecoveryStrategy
impl Unpin for RecoveryStrategy
impl !UnwindSafe for RecoveryStrategy
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