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
Auto Trait Implementations§
impl Freeze for Limits
impl RefUnwindSafe for Limits
impl Send for Limits
impl Sync for Limits
impl Unpin for Limits
impl UnwindSafe for Limits
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more