Struct tikv_client::Backoff[][src]

pub struct Backoff {
    kind: BackoffKind,
    current_attempts: u32,
    max_attempts: u32,
    base_delay_ms: u64,
    current_delay_ms: u64,
    max_delay_ms: u64,
}

When a request is retried, we can backoff for some time to avoid saturating the network.

Backoff is an object which determines how long to wait for.

Fields

kind: BackoffKindcurrent_attempts: u32max_attempts: u32base_delay_ms: u64current_delay_ms: u64max_delay_ms: u64

Implementations

impl Backoff[src]

pub fn next_delay_duration(&mut self) -> Option<Duration>[src]

pub fn is_none(&self) -> bool[src]

True if we should not backoff at all (usually indicates that we should not retry a request).

pub const fn no_backoff() -> Backoff[src]

Don’t wait. Usually indicates that we should not retry a request.

pub const fn no_jitter_backoff(
    base_delay_ms: u64,
    max_delay_ms: u64,
    max_attempts: u32
) -> Backoff
[src]

pub fn full_jitter_backoff(
    base_delay_ms: u64,
    max_delay_ms: u64,
    max_attempts: u32
) -> Backoff
[src]

pub fn equal_jitter_backoff(
    base_delay_ms: u64,
    max_delay_ms: u64,
    max_attempts: u32
) -> Backoff
[src]

pub fn decorrelated_jitter_backoff(
    base_delay_ms: u64,
    max_delay_ms: u64,
    max_attempts: u32
) -> Backoff
[src]

Trait Implementations

impl Clone for Backoff[src]

impl Debug for Backoff[src]

impl Eq for Backoff[src]

impl PartialEq<Backoff> for Backoff[src]

impl StructuralEq for Backoff[src]

impl StructuralPartialEq for Backoff[src]

Auto Trait Implementations

impl RefUnwindSafe for Backoff

impl Send for Backoff

impl Sync for Backoff

impl Unpin for Backoff

impl UnwindSafe for Backoff

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 
[src]