pub struct RateLimit { /* private fields */ }Implementations§
Source§impl RateLimit
impl RateLimit
pub fn disabled() -> Self
pub fn default_limit(self, limit: Limit) -> Self
pub fn rule(self, pattern: impl Into<String>, limit: Limit) -> Self
Sourcepub fn account_limit(self, limit: Option<Limit>) -> Self
pub fn account_limit(self, limit: Option<Limit>) -> Self
A second limit on routes with a rule of their own (sign-in, sign-up, password reset,
plugin routes that send mail or check codes), kept per account the JSON body names
(email or username) whatever the client IP. It stops guesses at one account
spread over many addresses. Default: 30 requests per 10 minutes; None turns it off.
Sourcepub fn ipv6_prefix(self, bits: u8) -> Self
pub fn ipv6_prefix(self, bits: u8) -> Self
IPv6 clients share one bucket per network prefix of this many bits (default 64, as in Better Auth), because one subscriber or cloud VM holds a whole /64. 128 keeps every address apart.
Trait Implementations§
Auto Trait Implementations§
impl Forget for RateLimit
impl Freeze for RateLimit
impl Move 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