[][src]Struct multer::SizeLimit

pub struct SizeLimit { /* fields omitted */ }

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

impl Default for SizeLimit[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.