pub struct Backoff {
pub initial: Duration,
pub max: Duration,
pub multiplier: f64,
pub max_retries: Option<u32>,
}Expand description
Exponential reconnect backoff. Delays grow initial * multiplier^attempt,
capped at max. No jitter is applied (a single client reconnecting to a
single node needs none); add it externally if fanning many clients at one
server.
Fields§
§initial: DurationDelay before the first retry.
max: DurationUpper bound on any single delay.
multiplier: f64Per-attempt growth factor.
max_retries: Option<u32>Give up after this many consecutive reconnect attempts produce no event,
surfacing the last error from next. The
initial connect is not counted; a connection that delivers any event
resets the count. None retries forever.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Backoff
impl RefUnwindSafe for Backoff
impl Send for Backoff
impl Sync for Backoff
impl Unpin for Backoff
impl UnsafeUnpin for Backoff
impl UnwindSafe for Backoff
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request