pub struct GovernorExtractor<K: KeyExtractor = PeerIpKeyExtractor>(pub GovernorResult<K::KeyExtractionError>);Expand description
Extractor for governor rate limit results.
To use this extractor, don’t forget to set GovernorConfig to permissive,
or the request will be rejected before reaching your handler.
Tuple Fields§
§0: GovernorResult<K::KeyExtractionError>Trait Implementations§
Source§impl<K: KeyExtractor> FromRequest for GovernorExtractor<K>
impl<K: KeyExtractor> FromRequest for GovernorExtractor<K>
Source§type Future = Ready<Result<GovernorExtractor<K>, <GovernorExtractor<K> as FromRequest>::Error>>
type Future = Ready<Result<GovernorExtractor<K>, <GovernorExtractor<K> as FromRequest>::Error>>
Future that resolves to a
Self. Read moreSource§fn from_request(req: &HttpRequest, _: &mut Payload) -> Self::Future
fn from_request(req: &HttpRequest, _: &mut Payload) -> Self::Future
Create a
Self from request parts asynchronously.Auto Trait Implementations§
impl<K> Freeze for GovernorExtractor<K>
impl<K> RefUnwindSafe for GovernorExtractor<K>
impl<K> Send for GovernorExtractor<K>
impl<K> Sync for GovernorExtractor<K>
impl<K> Unpin for GovernorExtractor<K>
impl<K> UnwindSafe for GovernorExtractor<K>
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