Struct retry::Retry
[−]
[src]
pub struct Retry<'a, F: FnMut() -> R + 'a, G: FnMut(&R) -> bool + 'a, R> { // some fields omitted }
Builder object for a retryable operation.
Methods
impl<'a, F: FnMut() -> R, G: FnMut(&R) -> bool, R> Retry<'a, F, G, R>
[src]
fn new(value_fn: &'a mut F, condition_fn: &'a mut G) -> Retry<'a, F, G, R> where F: FnMut() -> R, G: FnMut(&R) -> bool
Build a new Retry
object.
fn execute(self) -> Result<R, RetryError>
Begin executing the retryable operation.
fn try(self, tries: u32) -> Retry<'a, F, G, R>
Set a maximum number of tries to make before failing.
fn wait(self, wait: u32) -> Retry<'a, F, G, R>
Set the number of milliseconds to wait after an unsuccesful try before trying again.