[−][src]Struct multer::SizeLimit
Represents size limit of the stream to prevent DoS attacks.
Please refer Constraints
for more info.
Implementations
impl SizeLimit
[src]
pub fn new() -> SizeLimit
[src]
Creates a default size limit which is std::u64::MAX
for the whole stream
and for each field.
pub fn whole_stream(self, limit: u64) -> SizeLimit
[src]
Sets size limit for the whole stream.
pub fn per_field(self, limit: u64) -> SizeLimit
[src]
Sets size limit for each field.
pub fn for_field<N: Into<String>>(self, field_name: N, limit: u64) -> SizeLimit
[src]
Sets size limit for a specific field, it overrides the per_field
value for this field.
It is useful when you want to set a size limit on a textual field which will be stored in memory to avoid potential DoS attacks from attackers running the server out of memory.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for SizeLimit
impl Send for SizeLimit
impl Sync for SizeLimit
impl Unpin for SizeLimit
impl UnwindSafe for SizeLimit
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,