pub struct BasicAuth { /* private fields */ }
Expand description
Basic authentication middleware
Implementations§
Source§impl BasicAuth
impl BasicAuth
Sourcepub fn new(config: BasicAuthConfig) -> AuthResult<Self>
pub fn new(config: BasicAuthConfig) -> AuthResult<Self>
Create new BasicAuth instance
Sourcepub fn metrics(&self) -> &AuthMetrics
pub fn metrics(&self) -> &AuthMetrics
Get metrics reference
Sourcepub fn with_users(users: HashMap<String, String>) -> AuthResult<Self>
pub fn with_users(users: HashMap<String, String>) -> AuthResult<Self>
Create BasicAuth with static user list
Sourcepub fn with_user(username: String, password: String) -> AuthResult<Self>
pub fn with_user(username: String, password: String) -> AuthResult<Self>
Create BasicAuth with a single user
Trait Implementations§
Auto Trait Implementations§
impl Freeze for BasicAuth
impl !RefUnwindSafe for BasicAuth
impl Send for BasicAuth
impl Sync for BasicAuth
impl Unpin for BasicAuth
impl !UnwindSafe for BasicAuth
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