pub enum RateLimit {
Rfc6585(Headers),
RetryAfter(RateLimit),
}Expand description
Rate Limit information, parsed from HTTP headers.
There are multiple ways to represent rate limit information in HTTP headers. The following variants are supported:
Variants§
Rfc6585(Headers)
Rate limit information as per the [IETF “Polly” draft][ietf].
RetryAfter(RateLimit)
Rate limit information as per the Retry-After header.
Implementations§
Source§impl RateLimit
impl RateLimit
Sourcepub fn new<T: Into<CaseSensitiveHeaderMap>>(headers: T) -> Result<Self, Error>
pub fn new<T: Into<CaseSensitiveHeaderMap>>(headers: T) -> Result<Self, Error>
Create a new RateLimit from a http::HeaderMap.
Sourcepub const fn reset(&self) -> ResetTime
pub const fn reset(&self) -> ResetTime
Get reset time.
This is the time when the rate limit will be reset.
Trait Implementations§
impl Copy for RateLimit
impl StructuralPartialEq for RateLimit
Auto Trait Implementations§
impl Freeze for RateLimit
impl RefUnwindSafe for RateLimit
impl Send for RateLimit
impl Sync for RateLimit
impl Unpin for RateLimit
impl UnwindSafe for RateLimit
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