pub struct CategoryStats {
pub request_count: u32,
pub requests_per_second: u32,
pub last_request: Option<Instant>,
pub next_available: Option<Instant>,
}
Expand description
Statistics for a specific rate limit category
Fields§
§request_count: u32
Current request count in this second
requests_per_second: u32
Maximum requests per second for this category
last_request: Option<Instant>
When the last request was made
next_available: Option<Instant>
When the next request can be made
Implementations§
Source§impl CategoryStats
impl CategoryStats
Sourcepub fn is_at_limit(&self) -> bool
pub fn is_at_limit(&self) -> bool
Check if this category is currently at its rate limit
Sourcepub fn remaining_capacity(&self) -> u32
pub fn remaining_capacity(&self) -> u32
Get remaining capacity for this category
Trait Implementations§
Source§impl Clone for CategoryStats
impl Clone for CategoryStats
Source§fn clone(&self) -> CategoryStats
fn clone(&self) -> CategoryStats
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for CategoryStats
impl RefUnwindSafe for CategoryStats
impl Send for CategoryStats
impl Sync for CategoryStats
impl Unpin for CategoryStats
impl UnwindSafe for CategoryStats
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