Struct twilight_http::ratelimiting::Ratelimiter [−][src]
pub struct Ratelimiter { /* fields omitted */ }
Implementations
impl Ratelimiter
[src]
impl Ratelimiter
[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]
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]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Default for Ratelimiter
[src]
impl Default for Ratelimiter
[src]fn default() -> Ratelimiter
[src]
Auto Trait Implementations
impl !RefUnwindSafe for Ratelimiter
impl !RefUnwindSafe for Ratelimiter
impl Send for Ratelimiter
impl Send for Ratelimiter
impl Sync for Ratelimiter
impl Sync for Ratelimiter
impl Unpin for Ratelimiter
impl Unpin for Ratelimiter
impl !UnwindSafe for Ratelimiter
impl !UnwindSafe for Ratelimiter
Blanket Implementations
impl<T> Instrument for T
[src]
impl<T> Instrument for T
[src]pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,