pub type Request<T = Body> = Request<T>;Expand description
Represents an HTTP Request.
Aliased Type§
pub struct Request<T = Body> { /* private fields */ }Trait Implementations§
Source§impl RequestExt for Request
impl RequestExt for Request
Source§fn query_string(&self) -> Option<&str>
fn query_string(&self) -> Option<&str>
Get URL’s query string of this request.
Source§fn query<T>(&self) -> Result<T, PayloadError>where
T: DeserializeOwned,
fn query<T>(&self) -> Result<T, PayloadError>where
T: DeserializeOwned,
Available on crate feature
query only.Get query data by type. Read more
Source§fn header<K, T>(&self, key: K) -> Option<T>where
K: AsHeaderName,
T: FromStr,
fn header<K, T>(&self, key: K) -> Option<T>where
K: AsHeaderName,
T: FromStr,
Get a header with the key.
Source§fn header_typed<H>(&self) -> Option<H>where
H: Header,
fn header_typed<H>(&self) -> Option<H>where
H: Header,
Get a header with the specified type.
Source§fn content_length(&self) -> Option<u64>
fn content_length(&self) -> Option<u64>
Get the size of this request’s body.
Source§fn content_type(&self) -> Option<Mime>
fn content_type(&self) -> Option<Mime>
Get the media type of this request.
Source§async fn extract<T>(&mut self) -> Result<T, T::Error>where
T: FromRequest,
async fn extract<T>(&mut self) -> Result<T, T::Error>where
T: FromRequest,
Extract the data from this request by the specified type.
Source§async fn bytes(&mut self) -> Result<Bytes, PayloadError>
async fn bytes(&mut self) -> Result<Bytes, PayloadError>
Return with a Bytes representation of the request body.
Source§async fn text(&mut self) -> Result<String, PayloadError>
async fn text(&mut self) -> Result<String, PayloadError>
Return with a Text representation of the request body.
Source§async fn form<T>(&mut self) -> Result<T, PayloadError>where
T: DeserializeOwned,
async fn form<T>(&mut self) -> Result<T, PayloadError>where
T: DeserializeOwned,
Available on crate feature
form only.Return with a
application/x-www-form-urlencoded FormData by the specified type
representation of the request body.Source§async fn json<T>(&mut self) -> Result<T, PayloadError>where
T: DeserializeOwned,
async fn json<T>(&mut self) -> Result<T, PayloadError>where
T: DeserializeOwned,
Available on crate feature
json only.Return with a JSON by the specified type representation of the request body.
Source§async fn multipart(&mut self) -> Result<Multipart, PayloadError>
async fn multipart(&mut self) -> Result<Multipart, PayloadError>
Available on crate feature
multipart only.Return with a
multipart/form-data FormData by the specified type
representation of the request body.Source§fn state<T>(&self) -> Option<T>
fn state<T>(&self) -> Option<T>
Available on crate feature
state only.Return a shared state by the specified type.
Source§fn set_state<T>(&mut self, t: T) -> Option<T>
fn set_state<T>(&mut self, t: T) -> Option<T>
Available on crate feature
state only.Store a shared state.
Available on crate feature
cookie only.Get a cookie by the specified name.
Source§fn params<T>(&self) -> Result<T, ParamsError>where
T: DeserializeOwned,
fn params<T>(&self) -> Result<T, ParamsError>where
T: DeserializeOwned,
Available on crate feature
params only.Get all parameters. Read more
Source§fn param<T>(&self, name: &str) -> Result<T, ParamsError>
fn param<T>(&self, name: &str) -> Result<T, ParamsError>
Available on crate feature
params only.Get single parameter by name. Read more
Source§fn remote_addr(&self) -> Option<&SocketAddr>
fn remote_addr(&self) -> Option<&SocketAddr>
Get remote addr.
Source§fn route_info(&self) -> &Arc<RouteInfo>
fn route_info(&self) -> &Arc<RouteInfo>
Available on crate feature
params only.Get current route.
Source§impl RequestLimitsExt for Request
Available on crate feature limits only.
impl RequestLimitsExt for Request
Available on crate feature
limits only.Source§async fn bytes_with(
&mut self,
limit: Option<u64>,
max: u64,
) -> Result<Bytes, PayloadError>
async fn bytes_with( &mut self, limit: Option<u64>, max: u64, ) -> Result<Bytes, PayloadError>
Return with a Bytes by a limit representation of the request body.
Source§async fn text_with_limit(&mut self) -> Result<String, PayloadError>
async fn text_with_limit(&mut self) -> Result<String, PayloadError>
Return with a limited Text representation of the request body.
Source§async fn form_with_limit<T>(&mut self) -> Result<T, PayloadError>where
T: DeserializeOwned,
async fn form_with_limit<T>(&mut self) -> Result<T, PayloadError>where
T: DeserializeOwned,
Available on crate feature
form only.Return with a limited
application/x-www-form-urlencoded FormData by the specified type
representation of the request body.Source§async fn json_with_limit<T>(&mut self) -> Result<T, PayloadError>where
T: DeserializeOwned,
async fn json_with_limit<T>(&mut self) -> Result<T, PayloadError>where
T: DeserializeOwned,
Available on crate feature
json only.Return with a limited JSON by the specified type representation of the request body.
Source§async fn multipart_with_limit(&mut self) -> Result<Multipart, PayloadError>
async fn multipart_with_limit(&mut self) -> Result<Multipart, PayloadError>
Available on crate feature
multipart only.Return with a limited
multipart/form-data FormData by the specified type
representation of the request body.