pub struct FallbackOptions {
pub retry: RetryPolicy,
pub allow_provider_fallback: bool,
pub sleeper: Arc<dyn Sleeper>,
pub clock: Arc<dyn Clock>,
}Expand description
Knobs that are not the stage.
The stage is deliberately absent: it is a positional argument of
execute_with_fallback so it cannot be defaulted away.
Fields§
§retry: RetryPolicyHow hard to try each candidate.
allow_provider_fallback: boolWhether the walk may move past the first candidate at all. Setting it
to false restricts a stage to one profile without changing the
router’s output.
sleeper: Arc<dyn Sleeper>Who waits between attempts.
clock: Arc<dyn Clock>Where attempt latencies come from.
Implementations§
Source§impl FallbackOptions
impl FallbackOptions
Sourcepub fn new() -> Self
pub fn new() -> Self
The default policy, sleeping on the Tokio timer and timing on the wall clock.
Sourcepub fn with_retry(self, retry: RetryPolicy) -> Self
pub fn with_retry(self, retry: RetryPolicy) -> Self
Sets the retry policy.
Sourcepub fn without_provider_fallback(self) -> Self
pub fn without_provider_fallback(self) -> Self
Restricts the stage to the first candidate.
Sourcepub fn with_sleeper<S: Sleeper + 'static>(self, sleeper: Arc<S>) -> Self
pub fn with_sleeper<S: Sleeper + 'static>(self, sleeper: Arc<S>) -> Self
Injects a sleeper.
Sourcepub fn with_clock<C: Clock + 'static>(self, clock: Arc<C>) -> Self
pub fn with_clock<C: Clock + 'static>(self, clock: Arc<C>) -> Self
Injects a clock.
Trait Implementations§
Source§impl Clone for FallbackOptions
impl Clone for FallbackOptions
Source§impl Debug for FallbackOptions
impl Debug for FallbackOptions
Auto Trait Implementations§
impl !RefUnwindSafe for FallbackOptions
impl !UnwindSafe for FallbackOptions
impl Freeze for FallbackOptions
impl Send for FallbackOptions
impl Sync for FallbackOptions
impl Unpin for FallbackOptions
impl UnsafeUnpin for FallbackOptions
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