pub struct Cookies(pub HashMap<String, String>);Expand description
Extract cookies from the request
§Example
use torch_web::extractors::Cookies;
use std::collections::HashMap;
async fn handler(Cookies(cookies): Cookies) {
if let Some(session_id) = cookies.get("session_id") {
// Handle session
}
}Tuple Fields§
§0: HashMap<String, String>Trait Implementations§
Auto Trait Implementations§
impl Freeze for Cookies
impl RefUnwindSafe for Cookies
impl Send for Cookies
impl Sync for Cookies
impl Unpin for Cookies
impl UnwindSafe for Cookies
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