Trait viz::RequestLimitsExt

source ·
pub trait RequestLimitsExt: Sealed + Sized {
    // Required methods
    fn limits(&self) -> &Limits;
    fn bytes_with(
        &mut self,
        limit: Option<u64>,
        max: u64
    ) -> impl Future<Output = Result<Bytes, PayloadError>> + Send;
    fn text_with_limit(
        &mut self
    ) -> impl Future<Output = Result<String, PayloadError>> + Send;
    fn form_with_limit<T>(
        &mut self
    ) -> impl Future<Output = Result<T, PayloadError>> + Send
       where T: DeserializeOwned;
    fn json_with_limit<T>(
        &mut self
    ) -> impl Future<Output = Result<T, PayloadError>> + Send
       where T: DeserializeOwned;
    fn multipart_with_limit(
        &mut self
    ) -> impl Future<Output = Result<FormData<Body>, PayloadError>> + Send;
}
Available on crate feature limits only.
Expand description

The Request Extension with a limited body.

Required Methods§

source

fn limits(&self) -> &Limits

Get limits settings.

source

fn bytes_with( &mut self, limit: Option<u64>, max: u64 ) -> impl Future<Output = Result<Bytes, PayloadError>> + Send

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

source

fn text_with_limit( &mut self ) -> impl Future<Output = Result<String, PayloadError>> + Send

Return with a limited Text representation of the request body.

source

fn form_with_limit<T>( &mut self ) -> impl Future<Output = Result<T, PayloadError>> + Send

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

fn json_with_limit<T>( &mut self ) -> impl Future<Output = Result<T, PayloadError>> + Send

Available on crate feature json only.

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

source

fn multipart_with_limit( &mut self ) -> impl Future<Output = Result<FormData<Body>, PayloadError>> + Send

Available on crate feature multipart only.

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

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl RequestLimitsExt for Request<Body>

source§

fn limits(&self) -> &Limits

source§

async fn bytes_with( &mut self, limit: Option<u64>, max: u64 ) -> Result<Bytes, PayloadError>

source§

async fn text_with_limit(&mut self) -> Result<String, PayloadError>

source§

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

Available on crate feature form only.
source§

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

Available on crate feature json only.
source§

async fn multipart_with_limit(&mut self) -> Result<FormData<Body>, PayloadError>

Available on crate feature multipart only.

Implementors§