pub struct SecurityState {
pub auth: AuthMiddleware,
pub rate_limiter: RateLimiter,
}Expand description
Security state for middleware
Fields§
§auth: AuthMiddlewareAuthentication middleware
rate_limiter: RateLimiterRate limiter
Implementations§
Source§impl SecurityState
impl SecurityState
Sourcepub fn new(auth: AuthMiddleware, rate_limiter: RateLimiter) -> Self
pub fn new(auth: AuthMiddleware, rate_limiter: RateLimiter) -> Self
Create new security state
Sourcepub fn development() -> Self
pub fn development() -> Self
Create development security state (no auth, disabled rate limiting)
Sourcepub fn production(token: &str) -> Self
pub fn production(token: &str) -> Self
Create production security state
Trait Implementations§
Source§impl Clone for SecurityState
impl Clone for SecurityState
Source§fn clone(&self) -> SecurityState
fn clone(&self) -> SecurityState
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for SecurityState
impl !RefUnwindSafe for SecurityState
impl Send for SecurityState
impl Sync for SecurityState
impl Unpin for SecurityState
impl !UnwindSafe for SecurityState
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