pub struct RateLimit {
pub limit: u16,
pub remaining: u16,
pub reset: Timestamp,
}Expand description
Rate limit information: the number of requests that can be made per hour, the remaining request count, and the time at which the limit will be reset.
Fields§
§limit: u16The total request limit for the hour.
remaining: u16The remaining requests for the hour.
reset: TimestampThe time at which the rate limit will be reset.
Implementations§
Source§impl RateLimit
impl RateLimit
Sourcepub const fn used(&self) -> u16
pub const fn used(&self) -> u16
The number of requests that have been used in this hourly block.
§Example
use pvoutput_client::types::response::RateLimit;
use jiff::Timestamp;
let rate_limit = RateLimit { limit: 300, remaining: 100, reset: Timestamp::now() };
assert_eq!(rate_limit.used(), 200);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