pub struct ErrorRecoveryStrategy { /* private fields */ }Expand description
Error recovery strategy with exponential backoff
Implementations§
Source§impl ErrorRecoveryStrategy
impl ErrorRecoveryStrategy
Sourcepub fn new() -> ErrorRecoveryStrategy
pub fn new() -> ErrorRecoveryStrategy
Create new error recovery strategy
Sourcepub fn with_max_retries(self, max_retries: u32) -> ErrorRecoveryStrategy
pub fn with_max_retries(self, max_retries: u32) -> ErrorRecoveryStrategy
Set maximum retries
Sourcepub fn with_base_delay(self, base_delay: Duration) -> ErrorRecoveryStrategy
pub fn with_base_delay(self, base_delay: Duration) -> ErrorRecoveryStrategy
Set base delay
Sourcepub fn with_max_delay(self, max_delay: Duration) -> ErrorRecoveryStrategy
pub fn with_max_delay(self, max_delay: Duration) -> ErrorRecoveryStrategy
Set maximum delay
Sourcepub fn with_jitter(self, jitter: f64) -> ErrorRecoveryStrategy
pub fn with_jitter(self, jitter: f64) -> ErrorRecoveryStrategy
Set jitter factor (0.0 - 1.0)
Sourcepub fn max_retries(&self) -> u32
pub fn max_retries(&self) -> u32
Get max retries
Sourcepub fn classify_error(&self, error: &Error) -> ErrorClassification
pub fn classify_error(&self, error: &Error) -> ErrorClassification
Classify an error
Sourcepub fn determine_action(&self, error: &Error, attempt: u32) -> RecoveryAction
pub fn determine_action(&self, error: &Error, attempt: u32) -> RecoveryAction
Determine recovery action
Sourcepub fn determine_action_with_fallback(
&self,
error: &Error,
attempt: u32,
) -> RecoveryAction
pub fn determine_action_with_fallback( &self, error: &Error, attempt: u32, ) -> RecoveryAction
Determine action with explicit GPU fallback
Sourcepub fn calculate_delay(&self, attempt: u32) -> Duration
pub fn calculate_delay(&self, attempt: u32) -> Duration
Calculate delay for retry attempt with exponential backoff
Trait Implementations§
Source§impl Default for ErrorRecoveryStrategy
impl Default for ErrorRecoveryStrategy
Source§fn default() -> ErrorRecoveryStrategy
fn default() -> ErrorRecoveryStrategy
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Forget for ErrorRecoveryStrategy
impl Freeze for ErrorRecoveryStrategy
impl Move for ErrorRecoveryStrategy
impl RefUnwindSafe for ErrorRecoveryStrategy
impl Send for ErrorRecoveryStrategy
impl Sync for ErrorRecoveryStrategy
impl Unpin for ErrorRecoveryStrategy
impl UnsafeUnpin for ErrorRecoveryStrategy
impl UnwindSafe for ErrorRecoveryStrategy
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<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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