#[non_exhaustive]pub struct RetryState {
pub idempotent: bool,
pub start: Instant,
pub attempt_count: u32,
}Expand description
The input into a retry policy query.
On an error, the client library queries the retry policy as to whether it should make a new attempt. The client library provides an instance of this type to the retry policy.
This struct may gain new fields in future versions of the client libraries.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.idempotent: boolIf true, the request is idempotent and it is safe to retry.
Some policies retry non-idempotent operations because they are safe for a given configuration of the service or client.
start: InstantThe start time for this retry loop.
attempt_count: u32The number of times the request has been attempted.
Implementations§
Source§impl RetryState
impl RetryState
Sourcepub fn set_idempotent(self, v: bool) -> Self
pub fn set_idempotent(self, v: bool) -> Self
Update the idempotency.
Sourcepub fn set_attempt_count<T: Into<u32>>(self, v: T) -> Self
pub fn set_attempt_count<T: Into<u32>>(self, v: T) -> Self
Update the attempt count, useful in mocks.
Trait Implementations§
Source§impl Clone for RetryState
impl Clone for RetryState
Source§fn clone(&self) -> RetryState
fn clone(&self) -> RetryState
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RetryState
impl Debug for RetryState
Auto Trait Implementations§
impl Freeze for RetryState
impl RefUnwindSafe for RetryState
impl Send for RetryState
impl Sync for RetryState
impl Unpin for RetryState
impl UnwindSafe for RetryState
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