pub struct RateLimited<R, E> { /* private fields */ }Expand description
An endpoint with declared rate limits.
This is a type-level declaration — the actual enforcement is done by the framework’s rate limiting middleware, which reads the limits from the type at startup.
ⓘ
struct StandardRate;
impl RateLimit for StandardRate {
const MAX_REQUESTS: u32 = 100;
const WINDOW_SECS: u64 = 60;
}
type API = (
RateLimited<StandardRate, PostEndpoint<LoginPath, LoginReq, LoginRes>>,
);Trait Implementations§
Source§impl<R: RateLimit, E: BindableEndpoint> BindableEndpoint for RateLimited<R, E>
impl<R: RateLimit, E: BindableEndpoint> BindableEndpoint for RateLimited<R, E>
impl<R: RateLimit, E: ApiSpec> ApiSpec for RateLimited<R, E>
Auto Trait Implementations§
impl<R, E> Freeze for RateLimited<R, E>
impl<R, E> RefUnwindSafe for RateLimited<R, E>where
R: RefUnwindSafe,
E: RefUnwindSafe,
impl<R, E> Send for RateLimited<R, E>
impl<R, E> Sync for RateLimited<R, E>
impl<R, E> Unpin for RateLimited<R, E>
impl<R, E> UnsafeUnpin for RateLimited<R, E>
impl<R, E> UnwindSafe for RateLimited<R, E>where
R: UnwindSafe,
E: UnwindSafe,
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