pub struct RateLimitBuilder { /* private fields */ }Expand description
Sub-builder for rate limiting policy.
Entered via [AuthBuilder::with_rate_limit()]; call
done() to return to the parent builder.
Implementations§
Source§impl RateLimitBuilder
impl RateLimitBuilder
Sourcepub fn per_ip(self, (requests, window): (u32, Duration)) -> Self
pub fn per_ip(self, (requests, window): (u32, Duration)) -> Self
Configure rate limiting per IP.
§Example
use auth_framework::prelude::*;
use std::time::Duration;
let builder = AuthFramework::builder()
.with_rate_limiting().per_ip((200, Duration::from_secs(60))).done();Sourcepub fn disabled(self) -> Self
pub fn disabled(self) -> Self
Disable rate limiting.
§Example
use auth_framework::prelude::*;
let builder = AuthFramework::builder()
.with_rate_limiting().disabled().done();Sourcepub fn done(self) -> AuthBuilder
pub fn done(self) -> AuthBuilder
Complete rate limiting configuration and return to main builder.
Auto Trait Implementations§
impl Freeze for RateLimitBuilder
impl !RefUnwindSafe for RateLimitBuilder
impl Send for RateLimitBuilder
impl Sync for RateLimitBuilder
impl Unpin for RateLimitBuilder
impl UnsafeUnpin for RateLimitBuilder
impl !UnwindSafe for RateLimitBuilder
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more