pub struct RateLimitInfo {
pub remaining: Option<u32>,
pub reset_time: Option<DateTime<Utc>>,
pub limit: Option<u32>,
}Expand description
Rate limit information parsed from API response headers
Fields§
§remaining: Option<u32>Remaining requests in current window
reset_time: Option<DateTime<Utc>>Reset time when the rate limit window resets
limit: Option<u32>Limit of requests per window
Implementations§
Source§impl RateLimitInfo
impl RateLimitInfo
Sourcepub fn is_rate_limited(&self) -> bool
pub fn is_rate_limited(&self) -> bool
Check if rate limited (no remaining requests)
Sourcepub fn is_approaching_limit(&self) -> bool
pub fn is_approaching_limit(&self) -> bool
Check if approaching rate limit (less than 10% remaining)
Sourcepub fn wait_seconds(&self) -> Option<u64>
pub fn wait_seconds(&self) -> Option<u64>
Get wait time until reset (in seconds)
Trait Implementations§
Source§impl Clone for RateLimitInfo
impl Clone for RateLimitInfo
Auto Trait Implementations§
impl Freeze for RateLimitInfo
impl RefUnwindSafe for RateLimitInfo
impl Send for RateLimitInfo
impl Sync for RateLimitInfo
impl Unpin for RateLimitInfo
impl UnsafeUnpin for RateLimitInfo
impl UnwindSafe for RateLimitInfo
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<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more