pub struct RateLimit { /* private fields */ }Expand description
Validated rate-limit metadata returned by a transport.
Implementations§
Source§impl RateLimit
impl RateLimit
Sourcepub const fn new(
limit: u64,
remaining: u64,
reset_epoch_seconds: u64,
) -> Result<Self, RateLimitError>
pub const fn new( limit: u64, remaining: u64, reset_epoch_seconds: u64, ) -> Result<Self, RateLimitError>
Creates coherent rate-limit metadata.
Sourcepub const fn remaining(self) -> u64
pub const fn remaining(self) -> u64
Returns the number of requests remaining in the current time frame.
Sourcepub const fn reset_epoch_seconds(self) -> u64
pub const fn reset_epoch_seconds(self) -> u64
Returns the provider reset time as Unix epoch seconds.
Trait Implementations§
impl Copy for RateLimit
impl Eq for RateLimit
impl StructuralPartialEq for RateLimit
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