Struct twilight_http::ratelimiting::Ratelimiter [−][src]
pub struct Ratelimiter { /* fields omitted */ }
Implementations
impl Ratelimiter
[src]
impl Ratelimiter
[src]pub fn new() -> Self
[src]
pub fn new() -> Self
[src]Create a new ratelimiter.
Most users won’t need to use this directly. If you’re creating your own HTTP proxy then this is good to use for your own ratelimiting.
pub async fn get(
&self,
path: Path
) -> Receiver<Sender<Option<RatelimitHeaders>>>
[src]
&self,
path: Path
) -> Receiver<Sender<Option<RatelimitHeaders>>>
pub async fn time_until_available(&self, path: &Path) -> Option<Duration>
[src]
pub async fn time_until_available(&self, path: &Path) -> Option<Duration>
[src]Provide an estimate for the time left until a path can be used without being ratelimited.
This method is not guaranteed to be accurate and may return None if either no ratelimit is known or buckets are remaining.
Trait Implementations
impl Clone for Ratelimiter
[src]
impl Clone for Ratelimiter
[src]fn clone(&self) -> Ratelimiter
[src]
fn clone(&self) -> Ratelimiter
[src]Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]Performs copy-assignment from source
. Read more
impl Debug for Ratelimiter
[src]
impl Debug for Ratelimiter
[src]impl Default for Ratelimiter
[src]
impl Default for Ratelimiter
[src]fn default() -> Ratelimiter
[src]
fn default() -> Ratelimiter
[src]Returns the “default value” for a type. Read more
Auto Trait Implementations
impl !RefUnwindSafe for Ratelimiter
impl Send for Ratelimiter
impl Sync for Ratelimiter
impl Unpin for Ratelimiter
impl !UnwindSafe for Ratelimiter
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> Instrument for T
[src]
impl<T> Instrument for T
[src]fn instrument(self, span: Span) -> Instrumented<Self>
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
fn in_current_span(self) -> Instrumented<Self>
[src]
fn in_current_span(self) -> Instrumented<Self>
[src]impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,