Trait viz_core::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§
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.
Object Safety§
This trait is not object safe.