Type Alias viz_core::Request

source ·
pub type Request<T = Body> = Request<T>;
Expand description

Represents an HTTP Request.

Aliased Type§

struct Request<T = Body> { /* private fields */ }

Trait Implementations§

source§

impl RequestExt for Request

source§

fn schema(&self) -> Option<&Scheme>

Get URL’s schema of this request.
source§

fn path(&self) -> &str

Get URL’s path of this request.
source§

fn query_string(&self) -> Option<&str>

Get URL’s query string of this request.
source§

fn query<T>(&self) -> Result<T, PayloadError>

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,

Get a header with the key.
source§

fn header_typed<H>(&self) -> Option<H>
where H: Header,

Get a header with the specified type.
source§

fn content_length(&self) -> Option<u64>

Get the size of this request’s body.
source§

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,

Extract the data from this request by the specified type.
source§

fn incoming(&mut self) -> Result<Body, PayloadError>

Get an incoming body. Read more
source§

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>

Return with a Text representation of the request body.
source§

async fn form<T>(&mut self) -> Result<T, PayloadError>

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>

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>

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>
where T: Clone + Send + Sync + 'static,

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>
where T: Clone + Send + Sync + 'static,

Available on crate feature state only.
Store a shared state.
source§

fn cookies(&self) -> Result<Cookies, CookiesError>

Available on crate feature cookie only.
Get a wrapper of cookie-jar for managing cookies. Read more
source§

fn cookie<S>(&self, name: S) -> Option<Cookie<'_>>
where S: AsRef<str>,

Available on crate feature cookie only.
Get a cookie by the specified name.
source§

fn session(&self) -> &Session

Available on crate feature session only.
Get current session.
source§

fn params<T>(&self) -> Result<T, ParamsError>

Available on crate feature params only.
Get all parameters. Read more
source§

fn param<T>(&self, name: &str) -> Result<T, ParamsError>
where T: FromStr, T::Err: Display,

Available on crate feature params only.
Get single parameter by name. Read more
source§

fn remote_addr(&self) -> Option<&SocketAddr>

Get remote addr.
source§

fn route_info(&self) -> &Arc<RouteInfo>

Available on crate feature params only.
Get current route.
source§

fn realip(&self) -> Option<RealIp>

Get realip.
source§

impl RequestLimitsExt for Request

Available on crate feature limits only.
source§

fn limits(&self) -> &Limits

Get limits settings.
source§

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>

Return with a limited Text representation of the request body.
source§

async fn form_with_limit<T>(&mut self) -> Result<T, PayloadError>

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>

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>

Available on crate feature multipart only.
Return with a limited multipart/form-data FormData by the specified type representation of the request body.