pub struct PayloadConfig { /* private fields */ }Expand description
Payload configuration for request’s payload.
Implementations§
Source§impl PayloadConfig
impl PayloadConfig
Sourcepub fn limit(self, limit: usize) -> Self
pub fn limit(self, limit: usize) -> Self
Change max size of payload.
By default max size is 256Kb.
Sourcepub fn content_type<F>(self, predicate: F) -> Self
pub fn content_type<F>(self, predicate: F) -> Self
Set predicate for allowed content types.
The predicate receives the request’s parsed Content-Type. A request
without a Content-Type header, or one the predicate rejects, fails
with a content-type error. By default the content type is not checked.
Sourcepub fn mimetype(self, mt: Mime) -> Self
pub fn mimetype(self, mt: Mime) -> Self
Set required mime-type of the request.
This is a shorthand for content_type with a
predicate that accepts only mt. The comparison includes parameters,
such as charset. By default mime type is not enforced.
Trait Implementations§
Source§impl Clone for PayloadConfig
impl Clone for PayloadConfig
Source§fn clone(&self) -> PayloadConfig
fn clone(&self) -> PayloadConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PayloadConfig
impl Debug for PayloadConfig
Auto Trait Implementations§
impl !RefUnwindSafe for PayloadConfig
impl !UnwindSafe for PayloadConfig
impl Freeze for PayloadConfig
impl Send for PayloadConfig
impl Sync for PayloadConfig
impl Unpin for PayloadConfig
impl UnsafeUnpin for PayloadConfig
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