pub struct ErrorRecovery { /* private fields */ }Expand description
错误恢复管理器
Implementations§
Source§impl ErrorRecovery
impl ErrorRecovery
Sourcepub fn with_retry_policy(self, policy: RetryPolicy) -> Self
pub fn with_retry_policy(self, policy: RetryPolicy) -> Self
设置重试策略
Sourcepub fn with_fallback(self, strategy: FallbackStrategy) -> Self
pub fn with_fallback(self, strategy: FallbackStrategy) -> Self
设置降级策略
Sourcepub async fn set_user_callback(
&self,
callback: Arc<dyn Fn(&str, Vec<RecoveryAction>) -> RecoveryAction + Send + Sync>,
)
pub async fn set_user_callback( &self, callback: Arc<dyn Fn(&str, Vec<RecoveryAction>) -> RecoveryAction + Send + Sync>, )
设置用户确认回调
Sourcepub async fn execute_with_recovery<F, Fut, T>(
&self,
operation: F,
) -> RecoveryResult
pub async fn execute_with_recovery<F, Fut, T>( &self, operation: F, ) -> RecoveryResult
执行带恢复的操作
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for ErrorRecovery
impl !RefUnwindSafe for ErrorRecovery
impl !UnwindSafe for ErrorRecovery
impl Send for ErrorRecovery
impl Sync for ErrorRecovery
impl Unpin for ErrorRecovery
impl UnsafeUnpin for ErrorRecovery
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