pub struct RateLimit {
pub limit: u64,
pub remaining: u64,
pub reset: u64,
}Expand description
GitHub API rate limit information.
Provides information about API usage limits and reset times. Authenticated requests have a limit of 5000/hour, unauthenticated 60/hour.
Fields§
§limit: u64Maximum number of requests allowed per hour
remaining: u64Number of requests remaining in the current window
reset: u64Unix timestamp when the rate limit resets
Implementations§
Source§impl RateLimit
impl RateLimit
Sourcepub fn reset_datetime(&self) -> DateTime<Utc>
pub fn reset_datetime(&self) -> DateTime<Utc>
Returns the datetime when the rate limit resets.
Sourcepub fn time_until_reset(&self) -> Duration
pub fn time_until_reset(&self) -> Duration
Returns the duration until the rate limit resets.
Sourcepub fn is_exceeded(&self) -> bool
pub fn is_exceeded(&self) -> bool
Returns true if the rate limit has been exceeded (no requests remaining).
Trait Implementations§
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