tower::retry::budget

Trait Budget

Source
pub trait Budget {
    // Required methods
    fn deposit(&self);
    fn withdraw(&self) -> bool;
}
Expand description

For more info about Budget, please see the module-level documentation.

Required Methods§

Source

fn deposit(&self)

Store a “deposit” in the budget, which will be used to permit future withdrawals.

Source

fn withdraw(&self) -> bool

Check whether there is enough “balance” in the budget to issue a new retry.

If there is not enough, false is returned.

Implementors§