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§
Sourcefn bytes_with(
&mut self,
limit: Option<u64>,
max: u64,
) -> impl Future<Output = Result<Bytes, PayloadError>> + Send
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.
Sourcefn text_with_limit(
&mut self,
) -> impl Future<Output = Result<String, PayloadError>> + Send
fn text_with_limit( &mut self, ) -> impl Future<Output = Result<String, PayloadError>> + Send
Return with a limited Text representation of the request body.
Sourcefn form_with_limit<T>(
&mut self,
) -> impl Future<Output = Result<T, PayloadError>> + Sendwhere
T: DeserializeOwned,
Available on crate feature form only.
fn form_with_limit<T>(
&mut self,
) -> impl Future<Output = Result<T, PayloadError>> + Sendwhere
T: DeserializeOwned,
form only.Return with a limited application/x-www-form-urlencoded FormData by the specified type
representation of the request body.
Sourcefn json_with_limit<T>(
&mut self,
) -> impl Future<Output = Result<T, PayloadError>> + Sendwhere
T: DeserializeOwned,
Available on crate feature json only.
fn json_with_limit<T>(
&mut self,
) -> impl Future<Output = Result<T, PayloadError>> + Sendwhere
T: DeserializeOwned,
json only.Return with a limited JSON by the specified type representation of the request body.
Sourcefn multipart_with_limit(
&mut self,
) -> impl Future<Output = Result<Multipart, PayloadError>> + Send
Available on crate feature multipart only.
fn multipart_with_limit( &mut self, ) -> impl Future<Output = Result<Multipart, PayloadError>> + Send
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.