pub struct RetryState {
pub attempts: u32,
pub last_error: Option<MqttError>,
pub error_type: Option<RecoverableError>,
}Fields§
§attempts: u32§last_error: Option<MqttError>§error_type: Option<RecoverableError>Implementations§
Source§impl RetryState
impl RetryState
pub fn new() -> Self
pub fn record_attempt(&mut self, error: MqttError, error_type: RecoverableError)
pub fn should_retry(&self, config: &ErrorRecoveryConfig) -> bool
pub fn next_delay(&self, config: &ErrorRecoveryConfig) -> Duration
pub fn reset(&mut self)
Trait Implementations§
Source§impl Debug for RetryState
impl Debug for RetryState
Source§impl Default for RetryState
impl Default for RetryState
Source§fn default() -> RetryState
fn default() -> RetryState
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for RetryState
impl RefUnwindSafe for RetryState
impl Send for RetryState
impl Sync for RetryState
impl Unpin for RetryState
impl UnsafeUnpin for RetryState
impl UnwindSafe for RetryState
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