Struct salvo::Request[][src]

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>) -> Request[src]

Create a request from an hyper::Request.

This constructor consumes the hyper::Request.

pub fn uri(&self) -> &Uri[src]

pub fn uri_mut(&mut self) -> &mut Uri[src]

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

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

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

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

pub fn set_remote_addr(&mut self, remote_addr: Option<SocketAddr>)[src]

pub fn remote_addr(&self) -> Option<SocketAddr>[src]

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

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

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

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

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

pub fn extensions(&self) -> &Extensions[src]

pub fn extensions_mut(&mut self) -> &mut Extensions[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 cookies_mut(&mut self) -> &mut CookieJar[src]

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

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

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

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

pub fn get_query<F>(&self, key: &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_text(&'_ mut self) -> Result<&'_ str, ReadError>[src]

pub async fn read_from_text<T>(&'_ mut self) -> Result<T, ReadError> where
    T: FromStr
[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

impl !RefUnwindSafe for Request

impl Send for Request

impl Sync for Request

impl Unpin for Request

impl !UnwindSafe for Request

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, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

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>,