pub struct BlockingRetryWithContext<B, T, E, Ctx, F, SF = PleaseEnableAFeatureOrProvideACustomSleeper, RF = fn(_: &E) -> bool, NF = fn(_: &E, _: Duration)>{ /* private fields */ }Expand description
Retry structure generated by BlockingRetryableWithContext.
Implementations§
Source§impl<B, T, E, Ctx, F, SF, RF, NF> BlockingRetryWithContext<B, T, E, Ctx, F, SF, RF, NF>
impl<B, T, E, Ctx, F, SF, RF, NF> BlockingRetryWithContext<B, T, E, Ctx, F, SF, RF, NF>
Sourcepub fn context(
self,
context: Ctx,
) -> BlockingRetryWithContext<B, T, E, Ctx, F, SF, RF, NF>
pub fn context( self, context: Ctx, ) -> BlockingRetryWithContext<B, T, E, Ctx, F, SF, RF, NF>
Set the context for retrying.
Context is used to capture ownership manually to prevent lifetime issues.
Sourcepub fn sleep<SN>(
self,
sleep_fn: SN,
) -> BlockingRetryWithContext<B, T, E, Ctx, F, SN, RF, NF>where
SN: BlockingSleeper,
pub fn sleep<SN>(
self,
sleep_fn: SN,
) -> BlockingRetryWithContext<B, T, E, Ctx, F, SN, RF, NF>where
SN: BlockingSleeper,
Set the sleeper for retrying.
The sleeper should implement the BlockingSleeper trait. The simplest way is to use a closure like Fn(Duration).
If not specified, we use the DefaultBlockingSleeper.
Sourcepub fn when<RN>(
self,
retryable: RN,
) -> BlockingRetryWithContext<B, T, E, Ctx, F, SF, RN, NF>
pub fn when<RN>( self, retryable: RN, ) -> BlockingRetryWithContext<B, T, E, Ctx, F, SF, RN, NF>
Set the conditions for retrying.
If not specified, all errors are considered retryable.
Sourcepub fn notify<NN>(
self,
notify: NN,
) -> BlockingRetryWithContext<B, T, E, Ctx, F, SF, RF, NN>
pub fn notify<NN>( self, notify: NN, ) -> BlockingRetryWithContext<B, T, E, Ctx, F, SF, RF, NN>
Set to notify for all retry attempts.
When a retry happens, the input function will be invoked with the error and the sleep duration before pausing.
If not specified, this operation does nothing.
Source§impl<B, T, E, Ctx, F, SF, RF, NF> BlockingRetryWithContext<B, T, E, Ctx, F, SF, RF, NF>
impl<B, T, E, Ctx, F, SF, RF, NF> BlockingRetryWithContext<B, T, E, Ctx, F, SF, RF, NF>
Auto Trait Implementations§
impl<B, T, E, Ctx, F, SF, RF, NF> Freeze for BlockingRetryWithContext<B, T, E, Ctx, F, SF, RF, NF>
impl<B, T, E, Ctx, F, SF, RF, NF> RefUnwindSafe for BlockingRetryWithContext<B, T, E, Ctx, F, SF, RF, NF>where
B: RefUnwindSafe,
RF: RefUnwindSafe,
NF: RefUnwindSafe,
F: RefUnwindSafe,
SF: RefUnwindSafe,
Ctx: RefUnwindSafe,
impl<B, T, E, Ctx, F, SF, RF, NF> Send for BlockingRetryWithContext<B, T, E, Ctx, F, SF, RF, NF>
impl<B, T, E, Ctx, F, SF, RF, NF> Sync for BlockingRetryWithContext<B, T, E, Ctx, F, SF, RF, NF>
impl<B, T, E, Ctx, F, SF, RF, NF> Unpin for BlockingRetryWithContext<B, T, E, Ctx, F, SF, RF, NF>
impl<B, T, E, Ctx, F, SF, RF, NF> UnwindSafe for BlockingRetryWithContext<B, T, E, Ctx, F, SF, RF, NF>where
B: UnwindSafe,
RF: UnwindSafe,
NF: UnwindSafe,
F: UnwindSafe,
SF: UnwindSafe,
Ctx: UnwindSafe,
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> 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