pub struct MultipartForm { /* private fields */ }Expand description
Parsed multipart form data.
Implementations§
Source§impl MultipartForm
impl MultipartForm
Sourcepub fn new() -> MultipartForm
pub fn new() -> MultipartForm
Create a new empty form.
Sourcepub fn from_parts(parts: Vec<Part>) -> MultipartForm
pub fn from_parts(parts: Vec<Part>) -> MultipartForm
Create from parsed parts.
Sourcepub fn from_parts_with_spool_threshold(
parts: Vec<Part>,
spool_threshold: usize,
) -> MultipartForm
pub fn from_parts_with_spool_threshold( parts: Vec<Part>, spool_threshold: usize, ) -> MultipartForm
Create from parsed parts with a custom file spool threshold.
Sourcepub fn into_parts(self) -> Vec<Part>
pub fn into_parts(self) -> Vec<Part>
Consume the form and return all parsed parts.
Sourcepub fn get_file(&self, name: &str) -> Option<UploadFile>
pub fn get_file(&self, name: &str) -> Option<UploadFile>
Get a file by field name.
Sourcepub fn take_file(&mut self, name: &str) -> Option<UploadFile>
pub fn take_file(&mut self, name: &str) -> Option<UploadFile>
Remove and return a file by field name without cloning part data.
Sourcepub fn files(&self) -> Vec<UploadFile>
pub fn files(&self) -> Vec<UploadFile>
Get all files.
Sourcepub fn into_files(self) -> Vec<UploadFile>
pub fn into_files(self) -> Vec<UploadFile>
Consume the form and return all file uploads without cloning part data.
Sourcepub fn get_files(&self, name: &str) -> Vec<UploadFile>
pub fn get_files(&self, name: &str) -> Vec<UploadFile>
Get all values for a field name (for multiple file uploads).
Trait Implementations§
Source§impl Debug for MultipartForm
impl Debug for MultipartForm
Source§impl Default for MultipartForm
impl Default for MultipartForm
Source§fn default() -> MultipartForm
fn default() -> MultipartForm
Returns the “default value” for a type. Read more
Source§impl Drop for MultipartForm
impl Drop for MultipartForm
Source§impl FromRequest for MultipartForm
impl FromRequest for MultipartForm
Source§type Error = MultipartExtractError
type Error = MultipartExtractError
Error type when extraction fails.
Source§async fn from_request(
ctx: &RequestContext,
req: &mut Request,
) -> Result<MultipartForm, <MultipartForm as FromRequest>::Error>
async fn from_request( ctx: &RequestContext, req: &mut Request, ) -> Result<MultipartForm, <MultipartForm as FromRequest>::Error>
Extract a value from the request. Read more
Auto Trait Implementations§
impl Freeze for MultipartForm
impl RefUnwindSafe for MultipartForm
impl Send for MultipartForm
impl Sync for MultipartForm
impl Unpin for MultipartForm
impl UnwindSafe for MultipartForm
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, _span: NoopSpan) -> Self
fn instrument(self, _span: NoopSpan) -> Self
Instruments this future with a span (no-op when disabled).
Source§fn in_current_span(self) -> Self
fn in_current_span(self) -> Self
Instruments this future with the current span (no-op when disabled).