pub struct AuthRateLimiter { /* private fields */ }Implementations§
Source§impl AuthRateLimiter
impl AuthRateLimiter
pub fn new() -> Self
Process-wide singleton. Auth endpoints use this so per-IP counters survive across requests without plumbing a store through every call site.
Sourcepub fn check(
&self,
bucket: AuthBucket,
ip: &str,
account_key: Option<&str>,
) -> RateLimitDecision
pub fn check( &self, bucket: AuthBucket, ip: &str, account_key: Option<&str>, ) -> RateLimitDecision
Check + bump. account_key is the email/user_id/phone — pass
None for endpoints with no pre-auth account binding (e.g.
passkey/login/begin).
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for AuthRateLimiter
impl RefUnwindSafe for AuthRateLimiter
impl Send for AuthRateLimiter
impl Sync for AuthRateLimiter
impl Unpin for AuthRateLimiter
impl UnsafeUnpin for AuthRateLimiter
impl UnwindSafe for AuthRateLimiter
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