pub struct RateLimit {
pub limit: u32,
pub interval: Duration,
}Expand description
How many requests may be sent in a window.
Fields§
§limit: u32how many requests are allowed within interval
interval: Durationthe window that limit applies to
Implementations§
Source§impl RateLimit
impl RateLimit
Sourcepub const DOCUMENTED: Self
pub const DOCUMENTED: Self
The rate OpenCitations documents: 180 requests a minute, one every third of a second.
Used unless OpenCitationsBuilder::rate_limit
says otherwise. It is a per-address limit rather than a per-client one,
so it is worth lowering when something else on the same machine is also
querying.
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.