pub struct RateLimit<T: Store, CB: MessageBody = BoxBody> { /* private fields */ }Expand description
RateLimit is the rate-limit middleware.
Params [T]: the Store;
Params [CB]: the response body for Controller. (Controller.Body)
Implementations§
Trait Implementations§
Source§impl<T, CB, S, B> Transform<S, ServiceRequest> for RateLimit<T, CB>where
T: Store + 'static,
CB: MessageBody + 'static,
S: Service<ServiceRequest, Response = ServiceResponse<B>, Error = Error> + 'static,
S::Future: 'static,
B: 'static,
<T as Store>::Key: 'static,
impl<T, CB, S, B> Transform<S, ServiceRequest> for RateLimit<T, CB>where
T: Store + 'static,
CB: MessageBody + 'static,
S: Service<ServiceRequest, Response = ServiceResponse<B>, Error = Error> + 'static,
S::Future: 'static,
B: 'static,
<T as Store>::Key: 'static,
Source§type Response = ServiceResponse<EitherBody<B, EitherBody<BoxBody, CB>>>
type Response = ServiceResponse<EitherBody<B, EitherBody<BoxBody, CB>>>
Responses produced by the service.
Source§type Transform = RateLimitService<T, CB, S>
type Transform = RateLimitService<T, CB, S>
The
TransformService value created by this factorySource§type Future = Ready<Result<<RateLimit<T, CB> as Transform<S, ServiceRequest>>::Transform, <RateLimit<T, CB> as Transform<S, ServiceRequest>>::InitError>>
type Future = Ready<Result<<RateLimit<T, CB> as Transform<S, ServiceRequest>>::Transform, <RateLimit<T, CB> as Transform<S, ServiceRequest>>::InitError>>
The future response value.
Source§fn new_transform(&self, service: S) -> Self::Future
fn new_transform(&self, service: S) -> Self::Future
Creates and returns a new Transform component, asynchronously
Auto Trait Implementations§
impl<T, CB> Freeze for RateLimit<T, CB>
impl<T, CB> RefUnwindSafe for RateLimit<T, CB>
impl<T, CB> Send for RateLimit<T, CB>
impl<T, CB> Sync for RateLimit<T, CB>
impl<T, CB> Unpin for RateLimit<T, CB>
impl<T, CB> UnwindSafe for RateLimit<T, CB>
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