Struct actix_governor::GovernorConfig
source · pub struct GovernorConfig<K: KeyExtractor, M: RateLimitingMiddleware<QuantaInstant>> { /* private fields */ }
Expand description
Configuration for the Governor middleware.
Implementations§
source§impl<M: RateLimitingMiddleware<QuantaInstant>> GovernorConfig<PeerIpKeyExtractor, M>
impl<M: RateLimitingMiddleware<QuantaInstant>> GovernorConfig<PeerIpKeyExtractor, M>
sourcepub fn secure() -> Self
pub fn secure() -> Self
A default configuration for security related services. Allows bursts with up to two requests and replenishes one element after four seconds, based on peer IP.
This prevents brute-forcing passwords or security tokens yet allows to quickly retype a wrong password once before the quota is exceeded.
Trait Implementations§
source§impl<K: KeyExtractor, M: RateLimitingMiddleware<QuantaInstant>> Clone for GovernorConfig<K, M>
impl<K: KeyExtractor, M: RateLimitingMiddleware<QuantaInstant>> Clone for GovernorConfig<K, M>
source§impl<K: Debug + KeyExtractor, M: Debug + RateLimitingMiddleware<QuantaInstant>> Debug for GovernorConfig<K, M>where
K::Key: Debug,
impl<K: Debug + KeyExtractor, M: Debug + RateLimitingMiddleware<QuantaInstant>> Debug for GovernorConfig<K, M>where K::Key: Debug,
Auto Trait Implementations§
impl<K, M> !RefUnwindSafe for GovernorConfig<K, M>
impl<K, M> Send for GovernorConfig<K, M>where K: Send, M: Send + Sync, <K as KeyExtractor>::Key: Send + Sync,
impl<K, M> Sync for GovernorConfig<K, M>where K: Sync, M: Send + Sync, <K as KeyExtractor>::Key: Send + Sync,
impl<K, M> Unpin for GovernorConfig<K, M>where K: Unpin,
impl<K, M> !UnwindSafe for GovernorConfig<K, M>
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