pub struct RateLimitStatus {
pub remaining: u32,
pub limit: u32,
pub reset_at: u64,
}Expand description
Rate limit information from response headers.
Fields§
§remaining: u32Remaining requests in current window.
limit: u32Total limit for current window.
reset_at: u64Reset timestamp in seconds since epoch.
Implementations§
Source§impl RateLimitStatus
impl RateLimitStatus
Sourcepub fn new(remaining: u32, limit: u32, reset_at: u64) -> RateLimitStatus
pub fn new(remaining: u32, limit: u32, reset_at: u64) -> RateLimitStatus
Create new rate limit status.
Sourcepub fn is_rate_limited(&self) -> bool
pub fn is_rate_limited(&self) -> bool
Check if rate limited.
Sourcepub fn seconds_until_reset(&self) -> u64
pub fn seconds_until_reset(&self) -> u64
Get seconds until reset.
Trait Implementations§
Source§impl Clone for RateLimitStatus
impl Clone for RateLimitStatus
Source§fn clone(&self) -> RateLimitStatus
fn clone(&self) -> RateLimitStatus
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 moreAuto Trait Implementations§
impl Freeze for RateLimitStatus
impl RefUnwindSafe for RateLimitStatus
impl Send for RateLimitStatus
impl Sync for RateLimitStatus
impl Unpin for RateLimitStatus
impl UnwindSafe for RateLimitStatus
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