pub struct AuthConfig { /* private fields */ }
Expand description
Authentication Config
Helps wrapping a request handler behing authentication
§Example
use http::*;
use http_srv::handler::*;
let auth = AuthConfig::of_list(&[("user", "passwd")]);
let mut handler = Handler::default();
let func = |req: &mut HttpRequest| {
req.respond_str("Super secret message")
};
handler.get("/secret", auth.apply(func));
Implementations§
Auto Trait Implementations§
impl Freeze for AuthConfig
impl RefUnwindSafe for AuthConfig
impl Send for AuthConfig
impl Sync for AuthConfig
impl Unpin for AuthConfig
impl UnwindSafe for AuthConfig
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