pub struct RetryDirective {
pub earliest_retry_at: OffsetDateTime,
pub recommended_backoff: Duration,
pub reason: Option<String>,
}Expand description
Advises callers when to retry after a RateLimitDecision::Delay.
Fields§
§earliest_retry_at: OffsetDateTimeInstant when it is safe to retry.
recommended_backoff: DurationSuggested backoff duration.
reason: Option<String>Optional descriptive string.
Implementations§
Source§impl RetryDirective
impl RetryDirective
Sourcepub fn new(
earliest_retry_at: OffsetDateTime,
recommended_backoff: Duration,
) -> Self
pub fn new( earliest_retry_at: OffsetDateTime, recommended_backoff: Duration, ) -> Self
Creates a new directive with the provided timing metadata.
Sourcepub fn with_reason(self, reason: impl Into<String>) -> Self
pub fn with_reason(self, reason: impl Into<String>) -> Self
Adds a human-readable reason.
Trait Implementations§
Source§impl Clone for RetryDirective
impl Clone for RetryDirective
Source§fn clone(&self) -> RetryDirective
fn clone(&self) -> RetryDirective
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 RetryDirective
impl Debug for RetryDirective
Source§impl PartialEq for RetryDirective
impl PartialEq for RetryDirective
impl Eq for RetryDirective
impl StructuralPartialEq for RetryDirective
Auto Trait Implementations§
impl Freeze for RetryDirective
impl RefUnwindSafe for RetryDirective
impl Send for RetryDirective
impl Sync for RetryDirective
impl Unpin for RetryDirective
impl UnwindSafe for RetryDirective
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.