logo
pub trait RequestExt {
Show 21 methods fn path(&self) -> &str; fn query_string(&self) -> Option<&str>; fn query<T>(&self) -> Result<T, PayloadError>
    where
        T: DeserializeOwned
; fn header<K, T>(&self, key: K) -> Option<T>
    where
        K: AsHeaderName,
        T: FromStr
; fn content_length(&self) -> Option<u64>; fn content_type(&self) -> Option<Mime>; fn extract<'life0, 'async_trait, T>(
        &'life0 mut self
    ) -> Pin<Box<dyn Future<Output = Result<T, T::Error>> + Send + 'async_trait>>Notable traits for Pin<P>impl<P> Future for Pin<P> where
    P: DerefMut,
    <P as Deref>::Target: Future
type Output = <<P as Deref>::Target as Future>::Output;

    where
        T: FromRequest,
        T: 'async_trait,
        'life0: 'async_trait,
        Self: 'async_trait
; fn bytes<'life0, 'async_trait>(
        &'life0 mut self
    ) -> Pin<Box<dyn Future<Output = Result<Bytes, PayloadError>> + Send + 'async_trait>>Notable traits for Pin<P>impl<P> Future for Pin<P> where
    P: DerefMut,
    <P as Deref>::Target: Future
type Output = <<P as Deref>::Target as Future>::Output;

    where
        'life0: 'async_trait,
        Self: 'async_trait
; fn bytes_with<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        name: &'life1 str,
        max: u64
    ) -> Pin<Box<dyn Future<Output = Result<Bytes, PayloadError>> + Send + 'async_trait>>Notable traits for Pin<P>impl<P> Future for Pin<P> where
    P: DerefMut,
    <P as Deref>::Target: Future
type Output = <<P as Deref>::Target as Future>::Output;

    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
; fn text<'life0, 'async_trait>(
        &'life0 mut self
    ) -> Pin<Box<dyn Future<Output = Result<String, PayloadError>> + Send + 'async_trait>>Notable traits for Pin<P>impl<P> Future for Pin<P> where
    P: DerefMut,
    <P as Deref>::Target: Future
type Output = <<P as Deref>::Target as Future>::Output;

    where
        'life0: 'async_trait,
        Self: 'async_trait
; fn form<'life0, 'async_trait, T>(
        &'life0 mut self
    ) -> Pin<Box<dyn Future<Output = Result<T, PayloadError>> + Send + 'async_trait>>Notable traits for Pin<P>impl<P> Future for Pin<P> where
    P: DerefMut,
    <P as Deref>::Target: Future
type Output = <<P as Deref>::Target as Future>::Output;

    where
        T: DeserializeOwned,
        T: 'async_trait,
        'life0: 'async_trait,
        Self: 'async_trait
; fn json<'life0, 'async_trait, T>(
        &'life0 mut self
    ) -> Pin<Box<dyn Future<Output = Result<T, PayloadError>> + Send + 'async_trait>>Notable traits for Pin<P>impl<P> Future for Pin<P> where
    P: DerefMut,
    <P as Deref>::Target: Future
type Output = <<P as Deref>::Target as Future>::Output;

    where
        T: DeserializeOwned,
        T: 'async_trait,
        'life0: 'async_trait,
        Self: 'async_trait
; fn multipart<'life0, 'async_trait>(
        &'life0 mut self
    ) -> Pin<Box<dyn Future<Output = Result<Multipart, PayloadError>> + Send + 'async_trait>>Notable traits for Pin<P>impl<P> Future for Pin<P> where
    P: DerefMut,
    <P as Deref>::Target: Future
type Output = <<P as Deref>::Target as Future>::Output;

    where
        'life0: 'async_trait,
        Self: 'async_trait
; fn data<T>(&self) -> Option<T>
    where
        T: Clone + Send + Sync + 'static
; fn set_data<T>(&mut self, t: T) -> Option<T>
    where
        T: Clone + Send + Sync + 'static
; fn cookies(&self) -> Result<Cookies, CookiesError>; fn cookie<S>(&self, name: S) -> Option<Cookie<'_>>
    where
        S: AsRef<str>
; fn limits(&self) -> Limits; fn session(&self) -> &Session; fn params<T>(&self) -> Result<T, ParamsError>
    where
        T: DeserializeOwned
; fn param<T>(&self, name: &str) -> Result<T, ParamsError>
    where
        T: FromStr,
        T::Err: Display
;
}
Expand description

The Request Extension.

Required Methods

Get URL’s path of this request.

Get URL’s query string of this request.

Available on crate feature query only.

Get query data by type.

Get a header with the specified type by the key.

Get the size of this request’s body.

Get the media type of this request.

Extract the data from this request by the specified type.

Return with a Bytes representation of the request body.

Available on crate feature limits only.

Return with a Bytes by a limit representation of the request body.

Return with a Text representation of the request body.

Available on crate feature form only.

Return with a application/x-www-form-urlencoded FormData by the specified type representation of the request body.

Available on crate feature json only.

Return with a JSON by the specified type representation of the request body.

Available on crate feature multipart only.

Return with a multipart/form-data FormData by the specified type representation of the request body.

Available on crate feature data only.

Return a shared data by the specified type.

Available on crate feature data only.

Store a shared data.

Available on crate feature cookie only.

Get a wrapper of cookie-jar for managing cookies.

Available on crate feature cookie only.

Get a cookie by the specified name.

Available on crate feature limits only.

Get limits settings.

Available on crate feature session only.

Get current session.

Available on crate feature params only.

Get all parameters.

Available on crate feature params only.

Get single parameter by name.

Implementors