pub struct HttpRequest {
pub method: String,
pub url: String,
pub headers: Vec<HeaderField>,
pub body: Vec<u8>,
pub params: HashMap<String, String>,
pub path: String,
}Expand description
HttpRequest is the request type that is available in handler. It is a more user-friendly version of RawHttpRequest It is used in handler to allow user to process the request.
Fields§
§method: String§url: String§headers: Vec<HeaderField>§body: Vec<u8>§params: HashMap<String, String>§path: StringImplementations§
Source§impl HttpRequest
impl HttpRequest
pub fn body_into_struct<T: for<'a> Deserialize<'a>>( &self, ) -> Result<T, HttpResponse>
pub fn params_into_struct<T: for<'a> Deserialize<'a>>( &self, ) -> Result<T, HttpResponse>
Trait Implementations§
Source§impl CandidType for HttpRequest
impl CandidType for HttpRequest
Source§impl Clone for HttpRequest
impl Clone for HttpRequest
Source§fn clone(&self) -> HttpRequest
fn clone(&self) -> HttpRequest
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'de> Deserialize<'de> for HttpRequest
impl<'de> Deserialize<'de> for HttpRequest
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<RawHttpRequest> for HttpRequest
impl From<RawHttpRequest> for HttpRequest
Source§fn from(req: RawHttpRequest) -> Self
fn from(req: RawHttpRequest) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for HttpRequest
impl RefUnwindSafe for HttpRequest
impl Send for HttpRequest
impl Sync for HttpRequest
impl Unpin for HttpRequest
impl UnwindSafe 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