Struct relay_quotas::RetryAfter
source · pub struct RetryAfter { /* private fields */ }
Expand description
A monotonic expiration marker for RateLimit
s.
RetryAfter
marks an instant at which a rate limit expires, which is indicated by expired
. It
can convert into the remaining time until expiration.
Implementations§
source§impl RetryAfter
impl RetryAfter
sourcepub fn remaining(self) -> Option<Duration>
pub fn remaining(self) -> Option<Duration>
Returns the remaining duration until the rate limit expires.
sourcepub fn remaining_seconds(self) -> u64
pub fn remaining_seconds(self) -> u64
Returns the remaining seconds until the rate limit expires.
This is a shortcut to retry_after.remaining().as_secs()
with one exception: If the rate
limit has expired, this function returns 0
.
Trait Implementations§
source§impl Clone for RetryAfter
impl Clone for RetryAfter
source§fn clone(&self) -> RetryAfter
fn clone(&self) -> RetryAfter
Returns a copy 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 RetryAfter
impl Debug for RetryAfter
source§impl FromStr for RetryAfter
impl FromStr for RetryAfter
source§impl Hash for RetryAfter
impl Hash for RetryAfter
source§impl Ord for RetryAfter
impl Ord for RetryAfter
source§fn cmp(&self, other: &RetryAfter) -> Ordering
fn cmp(&self, other: &RetryAfter) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq for RetryAfter
impl PartialEq for RetryAfter
source§fn eq(&self, other: &RetryAfter) -> bool
fn eq(&self, other: &RetryAfter) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for RetryAfter
impl PartialOrd for RetryAfter
source§fn partial_cmp(&self, other: &RetryAfter) -> Option<Ordering>
fn partial_cmp(&self, other: &RetryAfter) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Copy for RetryAfter
impl Eq for RetryAfter
impl StructuralPartialEq for RetryAfter
Auto Trait Implementations§
impl Freeze for RetryAfter
impl RefUnwindSafe for RetryAfter
impl Send for RetryAfter
impl Sync for RetryAfter
impl Unpin for RetryAfter
impl UnwindSafe for RetryAfter
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
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.