pub struct UploadedFile { /* private fields */ }Expand description
A file received in a multipart/form-data request.
Implementations§
Source§impl UploadedFile
impl UploadedFile
Sourcepub fn client_file_name(&self) -> Option<&str>
pub fn client_file_name(&self) -> Option<&str>
The client-supplied file name.
Untrusted. A browser sends whatever the client says, which may
contain ../, a null byte, or a name designed to collide with
something on disk. Use extension and generate your
own name when storing; never join this onto a path.
Sourcepub fn content_type(&self) -> Option<&str>
pub fn content_type(&self) -> Option<&str>
The client-supplied MIME type. Also untrusted — sniff the contents if the distinction matters for security.
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Whether the part carried no content — a file input left empty submits an empty part rather than nothing at all.
Trait Implementations§
Source§impl Clone for UploadedFile
impl Clone for UploadedFile
Auto Trait Implementations§
impl !Freeze for UploadedFile
impl RefUnwindSafe for UploadedFile
impl Send for UploadedFile
impl Sync for UploadedFile
impl Unpin for UploadedFile
impl UnsafeUnpin for UploadedFile
impl UnwindSafe for UploadedFile
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