pub(super) async fn recover(
        &mut self,
        retries: &mut usize,
        deadline: &mut Option<Instant>,
        error: &Err,
    ) -> bool {
        match (self.recover)(*retries, error) {
            Recovery::Fail => return false,
            Recovery::Reconnect => self.inner = None,
        }

        // Set the deadline if it hasn't already been set and this is the first attempt
        if *retries == 0 && deadline.is_none() {
            *deadline = self.timeout.map(|delay| Instant::now() + delay);
        }

        // Note that one more retry has occurred
        *retries += 1;

        // If we got here, we didn't time out
        true
    }
/// Given an error, interpret the contained recovery strategy and return `true` if and only if
/// we should continue onwards. This function modifies `retries` and `deadline` to keep them
/// updated, with the assumption that they are initialized on the first occurrence of this error
/// at `0` and `None`, respectively.
Given an error, interpret the contained recovery strategy and return `true` if and only if
we should continue onwards.
Given an error interpret the contained recovery strategy and return ` true ` if and only if we should continue onwards .
pub(super) async fn recover(
        &mut self,
        retries: &mut usize,
        deadline: &mut Option<Instant>,
        error: &Err,
    ) -> bool {
        match (self.recover)(*retries, error) {
            Recovery::Fail => return false,
            Recovery::Reconnect => self.inner = None,
        }
        // Set the deadline if it hasn't already been set and this is the first attempt
        if *retries == 0 && deadline.is_none() {
            *deadline = self.timeout.map(|delay| Instant::now() + delay);
        }
        // Note that one more retry has occurred
        *retries += 1;
        // If we got here, we didn't time out
        true
    }
pub ( super ) async fn recover ( & mut self , retries : & mut usize , deadline : & mut Option < Instant > , error : & Err , ) -> bool { match ( self . recover ) ( * retries , error ) { Recovery :: Fail => return false , Recovery :: Reconnect => self . inner = None , } // Set the deadline if it hasn't already been set and this is the first attempt if * retries == 0 && deadline . is_none ( ) { * deadline = self . timeout . map ( | delay | Instant :: now ( ) + delay ) ; } // Note that one more retry has occurred * retries += 1 ; // If we got here, we didn't time out true }
Given an error, interpret the contained recovery strategy and return `true` if and only if
we should continue onwards.
Given an error interpret the contained recovery strategy and return ` true ` if and only if we should continue onwards .
&mut self
retries
&mut usize
deadline
&mut Option<Instant>
error
&Err