RequestLimitsExt

Trait 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<Multipart, 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<Multipart, 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.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§