pub struct MultipartConfig {
pub max_size: usize,
pub max_fields: usize,
pub max_file_size: usize,
pub allowed_content_types: Vec<String>,
}Expand description
Configuration for multipart form handling
Fields§
§max_size: usizeMaximum total size of the multipart form (default: 10MB)
max_fields: usizeMaximum number of fields (default: 100)
max_file_size: usizeMaximum size per file (default: 10MB)
allowed_content_types: Vec<String>Allowed content types for files (empty = all allowed)
Implementations§
Source§impl MultipartConfig
impl MultipartConfig
Sourcepub fn max_fields(self, count: usize) -> Self
pub fn max_fields(self, count: usize) -> Self
Set the maximum number of fields
Sourcepub fn max_file_size(self, size: usize) -> Self
pub fn max_file_size(self, size: usize) -> Self
Set the maximum file size
Sourcepub fn allowed_content_types(self, types: Vec<String>) -> Self
pub fn allowed_content_types(self, types: Vec<String>) -> Self
Set allowed content types for file uploads
Sourcepub fn allow_content_type(self, content_type: impl Into<String>) -> Self
pub fn allow_content_type(self, content_type: impl Into<String>) -> Self
Add an allowed content type
Trait Implementations§
Source§impl Clone for MultipartConfig
impl Clone for MultipartConfig
Source§fn clone(&self) -> MultipartConfig
fn clone(&self) -> MultipartConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for MultipartConfig
impl RefUnwindSafe for MultipartConfig
impl Send for MultipartConfig
impl Sync for MultipartConfig
impl Unpin for MultipartConfig
impl UnwindSafe for MultipartConfig
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