pub struct SizeLimit { /* private fields */ }
Expand description

Represents size limit of the stream to prevent DoS attacks.

Please refer Constraints for more info.

Implementations

Creates a default size limit which is u64::MAX for the whole stream and for each field.

Sets size limit for the whole stream.

Sets size limit for each field.

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

Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.