pub struct HttpRequest { /* private fields */ }Expand description
Concrete implementation of IHttpRequest.
Trait Implementations§
Source§impl IHttpRequest for HttpRequest
impl IHttpRequest for HttpRequest
Source§fn header(&self, name: &str) -> Option<&str>
fn header(&self, name: &str) -> Option<&str>
Header values are looked up case-insensitively, as HTTP requires.
fn method(&self) -> &str
fn path(&self) -> &str
fn query(&self) -> &HashMap<String, String>
Source§fn query_all(&self) -> Option<&HashMap<String, Vec<String>>>
fn query_all(&self) -> Option<&HashMap<String, Vec<String>>>
Every value per query key, in the order they appeared. Read more
Source§fn remote_addr(&self) -> Option<SocketAddr>
fn remote_addr(&self) -> Option<SocketAddr>
The peer address of the client connection, when the host exposes it. Read more
fn route_params(&self) -> &HashMap<String, String>
fn route_params_mut(&mut self) -> &mut HashMap<String, String>
Source§fn route_pattern(&self) -> Option<&str>
fn route_pattern(&self) -> Option<&str>
The original route pattern that was matched (e.g.,
"/api/users/{id}").
Set by the router after successful route matching.fn route_pattern_mut(&mut self) -> &mut Option<String>
Source§fn body_bytes<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn body_bytes<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Return the raw request body bytes. Read more
Source§fn body_text<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn body_text<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Return the request body as a UTF-8 string.
Source§fn multipart<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<Arc<MultipartForm>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn multipart<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<Arc<MultipartForm>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Parse the request body as
multipart/form-data. Read moreSource§fn content_type(&self) -> Option<&str>
fn content_type(&self) -> Option<&str>
The request’s media type, without parameters (e.g.
"multipart/form-data"). Read moreSource§fn is_multipart(&self) -> bool
fn is_multipart(&self) -> bool
Whether the request declares
Content-Type: multipart/form-data.Auto Trait Implementations§
impl !Freeze for HttpRequest
impl !RefUnwindSafe for HttpRequest
impl !UnwindSafe for HttpRequest
impl Forget for HttpRequest
impl Move for HttpRequest
impl Send for HttpRequest
impl Sync for HttpRequest
impl Unpin for HttpRequest
impl UnsafeUnpin for HttpRequest
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