Struct routerify_multipart::SizeLimit [−][src]
pub struct SizeLimit { /* fields omitted */ }
Expand description
Represents size limit of the stream to prevent DoS attacks.
Please refer Constraints
for more info.
Implementations
impl SizeLimit
[src]
impl SizeLimit
[src]pub fn new() -> SizeLimit
[src]
pub fn new() -> SizeLimit
[src]Creates a default size limit which is u64::MAX
for the whole stream
and for each field.
pub fn whole_stream(self, limit: u64) -> SizeLimit
[src]
pub fn whole_stream(self, limit: u64) -> SizeLimit
[src]Sets size limit for the whole stream.
pub fn for_field<N>(self, field_name: N, limit: u64) -> SizeLimit where
N: Into<String>,
[src]
pub fn for_field<N>(self, field_name: N, limit: u64) -> SizeLimit where
N: Into<String>,
[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> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> Instrument for T
[src]
impl<T> Instrument for T
[src]fn instrument(self, span: Span) -> Instrumented<Self>
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
fn in_current_span(self) -> Instrumented<Self>
[src]
fn in_current_span(self) -> Instrumented<Self>
[src]