pub struct Request {
pub method: Method,
pub uri: Uri,
pub version: Version,
pub headers: HeaderMap,
pub body: Bytes,
pub params: HashMap<String, String>,
pub query_params: HashMap<String, String>,
pub extensions: Extensions,
}Fields§
§method: Method§uri: Uri§version: Version§headers: HeaderMap§body: Bytes§params: HashMap<String, String>§query_params: HashMap<String, String>§extensions: ExtensionsImplementations§
Source§impl Request
Cookie utilities for Request
impl Request
Cookie utilities for Request
Get cookies from the request
Get a specific cookie value
Source§impl Request
impl Request
pub fn new( method: Method, uri: Uri, version: Version, headers: HeaderMap, body: Bytes, ) -> Self
pub fn json<T: DeserializeOwned>(&self) -> Result<T>
pub fn param(&self, key: &str) -> Option<&String>
pub fn query(&self, key: &str) -> Option<&String>
pub fn header(&self, key: &str) -> Option<&str>
Sourcepub fn insert_extension<T: Send + Sync + 'static>(&mut self, value: T)
pub fn insert_extension<T: Send + Sync + 'static>(&mut self, value: T)
Insert an extension value
Sourcepub fn get_extension<T: Send + Sync + Clone + 'static>(&self) -> Option<Arc<T>>
pub fn get_extension<T: Send + Sync + Clone + 'static>(&self) -> Option<Arc<T>>
Get an extension value (returns Arc
Sourcepub fn remove_extension<T: Send + Sync + 'static>(&mut self) -> Option<T>
pub fn remove_extension<T: Send + Sync + 'static>(&mut self) -> Option<T>
Remove an extension value
Sourcepub fn has_extension<T: Send + Sync + 'static>(&self) -> bool
pub fn has_extension<T: Send + Sync + 'static>(&self) -> bool
Check if an extension exists
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Request
impl RefUnwindSafe for Request
impl Send for Request
impl Sync for Request
impl Unpin for Request
impl UnwindSafe for Request
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