pub struct RetryController<'request, 'binding> { /* private fields */ }Expand description
Non-cloneable owner of one request’s retry state and idempotency intent.
ⓘ
use cloud_sdk::retry::RetryController;
fn duplicate(owner: RetryController<'_, '_>) {
let _second = owner.clone();
}Implementations§
Source§impl<'request, 'binding> RetryController<'request, 'binding>
impl<'request, 'binding> RetryController<'request, 'binding>
Sourcepub fn new(
subject: RetrySubject<'request, 'binding>,
idempotency: Option<IdempotencyBinding<'binding>>,
policy: RetryPolicy,
started: MonotonicInstant,
) -> Result<Self, RetryPolicyError>
pub fn new( subject: RetrySubject<'request, 'binding>, idempotency: Option<IdempotencyBinding<'binding>>, policy: RetryPolicy, started: MonotonicInstant, ) -> Result<Self, RetryPolicyError>
Creates the sole retry owner for one initial request attempt.
The moved intent is bound to the initial fingerprint. Mutating requests with more than one admitted attempt require a fresh intent.
Sourcepub const fn attempts(&self) -> u16
pub const fn attempts(&self) -> u16
Returns attempts already consumed, including the initial attempt.
Sourcepub const fn cumulative_delay(&self) -> MonotonicDuration
pub const fn cumulative_delay(&self) -> MonotonicDuration
Returns caller-requested delay already charged to this owner.
Sourcepub fn decide_retry<'controller, 'replay, 'subject>(
&'controller mut self,
event: RetryEvent,
replay: RetrySubject<'replay, 'subject>,
delay: MonotonicDuration,
now: MonotonicInstant,
) -> Result<RetryDecision<'controller, 'replay, 'subject>, RetryPolicyError>
pub fn decide_retry<'controller, 'replay, 'subject>( &'controller mut self, event: RetryEvent, replay: RetrySubject<'replay, 'subject>, delay: MonotonicDuration, now: MonotonicInstant, ) -> Result<RetryDecision<'controller, 'replay, 'subject>, RetryPolicyError>
Decides whether one exact replay may execute.
delay includes caller-selected backoff and jitter. This function does
not read clocks, sleep, execute transport, or classify provider errors.
Trait Implementations§
Auto Trait Implementations§
impl<'request, 'binding> !UnwindSafe for RetryController<'request, 'binding>
impl<'request, 'binding> Freeze for RetryController<'request, 'binding>
impl<'request, 'binding> RefUnwindSafe for RetryController<'request, 'binding>
impl<'request, 'binding> Send for RetryController<'request, 'binding>
impl<'request, 'binding> Sync for RetryController<'request, 'binding>
impl<'request, 'binding> Unpin for RetryController<'request, 'binding>
impl<'request, 'binding> UnsafeUnpin for RetryController<'request, 'binding>
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