Struct actix_multipart::form::Limits
source · pub struct Limits {
pub total_limit_remaining: usize,
pub memory_limit_remaining: usize,
pub field_limit_remaining: Option<usize>,
}
Expand description
Used to keep track of the remaining limits for the form and current field.
Fields§
§total_limit_remaining: usize
§memory_limit_remaining: usize
§field_limit_remaining: Option<usize>
Implementations§
source§impl Limits
impl Limits
pub fn new(total_limit: usize, memory_limit: usize) -> Self
sourcepub fn try_consume_limits(
&mut self,
bytes: usize,
in_memory: bool
) -> Result<(), MultipartError>
pub fn try_consume_limits( &mut self, bytes: usize, in_memory: bool ) -> Result<(), MultipartError>
This function should be called within a FieldReader
when reading each chunk of a field
to ensure that the form limits are not exceeded.
Arguments
bytes
- The number of bytes being read from this chunkin_memory
- Whether to consume from the memory limits