pub enum ResetTime {
Seconds(usize),
DateTime(OffsetDateTime),
}Expand description
Reset time of rate limiting
There are different variants on how to specify reset times in rate limit headers. The most common ones are seconds and datetime.
Variants§
Seconds(usize)
Number of seconds until rate limit is lifted
DateTime(OffsetDateTime)
Date when rate limit will be lifted
Implementations§
Source§impl ResetTime
impl ResetTime
Sourcepub fn new(value: &HeaderValue, kind: ResetTimeKind) -> Result<Self, Error>
pub fn new(value: &HeaderValue, kind: ResetTimeKind) -> Result<Self, Error>
Create a new reset time from a header value and a reset time kind
§Errors
This function returns an error if the header value cannot be parsed or if the reset time kind is unknown.
Trait Implementations§
impl Copy for ResetTime
impl StructuralPartialEq for ResetTime
Auto Trait Implementations§
impl Freeze for ResetTime
impl RefUnwindSafe for ResetTime
impl Send for ResetTime
impl Sync for ResetTime
impl Unpin for ResetTime
impl UnwindSafe for ResetTime
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