[][src]Struct salvo::Request

pub struct Request { /* fields omitted */ }

The Request given to all Middleware.

Stores all the properties of the client's request plus an TypeMap for data communication between middleware.

Implementations

impl Request[src]

pub fn from_hyper(
    req: Request<Body>,
    local_addr: Option<SocketAddr>,
    protocol: &Protocol
) -> Result<Request, String>
[src]

Create a request from an hyper::Request.

This constructor consumes the hyper::Request.

pub fn url(&self) -> &Url[src]

pub fn method(&self) -> &Method[src]

pub fn version(&self) -> Version[src]

pub fn body(&self) -> Option<&Body>[src]

pub fn take_body(&mut self) -> Option<Body>[src]

pub fn accept(&self) -> Vec<Mime, Global>[src]

pub fn frist_accept(&self) -> Option<Mime>[src]

pub fn content_type(&self) -> Option<Mime>[src]

pub fn cookies(&self) -> &CookieJar[src]

pub fn headers(&self) -> &HeaderMap<HeaderValue>[src]

pub fn get_header<K>(&self, key: K) -> Option<&HeaderValue> where
    K: AsHeaderName
[src]

pub fn params(&self) -> &HashMap<String, String, RandomState>[src]

pub fn get_param<F>(&self, key: &'a str) -> Option<F> where
    F: FromStr
[src]

pub fn queries(&self) -> &MultiMap<String, String, RandomState>[src]

pub fn get_query<F>(&self, key: &'a str) -> Option<F> where
    F: FromStr
[src]

pub async fn get_form<F>(&'_ mut self, key: &'_ str) -> Option<F> where
    F: FromStr
[src]

pub async fn get_file(&'_ mut self, key: &'_ str) -> Option<&'_ FilePart>[src]

pub async fn get_form_or_query<F>(&'_ mut self, key: &'_ str) -> Option<F> where
    F: FromStr
[src]

pub async fn get_query_or_form<F>(&'_ mut self, key: &'_ str) -> Option<F> where
    F: FromStr
[src]

pub async fn payload(&'_ mut self) -> Result<&'_ Vec<u8, Global>, ReadError>[src]

pub async fn form_data(&'_ mut self) -> Result<&'_ FormData, ReadError>[src]

pub async fn read_from_json<T>(&'_ mut self) -> Result<T, ReadError> where
    T: DeserializeOwned
[src]

pub async fn read_from_form<T>(&'_ mut self) -> Result<T, ReadError> where
    T: DeserializeOwned
[src]

pub async fn read<T>(&'_ mut self) -> Result<T, ReadError> where
    T: DeserializeOwned
[src]

Trait Implementations

impl Debug for Request[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,