usecrate::unit::ByteUnit;usepavex_macros::methods;useubyte::ToByteUnit;#[derive(Debug, Clone, Copy)]/// An upper limit on the size of incoming request bodies.
////// Check out the documentation of [`BufferedBody`](crate::request::body::BufferedBody) for more details.
pubenumBodySizeLimit{/// There is an active limit on the size of incoming request bodies.
Enabled {/// The maximum size of incoming request bodies, in bytes.
max_size: ByteUnit,},/// There is no limit on the size of incoming request bodies.
Disabled,}#[methods]implBodySizeLimit{/// Create a new [`BodySizeLimit`] using the default limit (2 MBs).
#[request_scoped(pavex = crate)]pubfnnew()-> BodySizeLimit{Self::default()}}implDefault forBodySizeLimit{fndefault()->Self{Self::Enabled {
max_size:2.megabytes(),}}}