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. Quotas depend on the API resource and authentication type.
Fields§
§limit: u64Maximum requests or points allowed in the current resource-specific window
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) -> Option<DateTime<Utc>>
pub fn reset_datetime(&self) -> Option<DateTime<Utc>>
Returns the reset datetime, or None if the timestamp cannot be represented.
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§
Source§impl<'de> Deserialize<'de> for RateLimit
impl<'de> Deserialize<'de> for RateLimit
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for RateLimit
impl RefUnwindSafe for RateLimit
impl Send for RateLimit
impl Sync for RateLimit
impl Unpin for RateLimit
impl UnsafeUnpin 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