pub struct Headers(pub HeaderMap);Expand description
Extract headers from the request
§Example
use torch_web::extractors::Headers;
use http::HeaderMap;
async fn handler(Headers(headers): Headers) {
if let Some(auth) = headers.get("authorization") {
// Handle authorization header
}
}Tuple Fields§
§0: HeaderMapTrait Implementations§
Auto Trait Implementations§
impl Freeze for Headers
impl RefUnwindSafe for Headers
impl Send for Headers
impl Sync for Headers
impl Unpin for Headers
impl UnwindSafe for Headers
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