#[non_exhaustive]pub enum FileUploadError {
FileTooLarge(usize, usize),
InvalidFileType(String),
Io(Error),
Upload(String),
ChecksumMismatch,
MimeDetectionFailed,
PathTraversal,
}Expand description
Errors that can occur during file upload operations
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
FileTooLarge(usize, usize)
The uploaded file exceeds the maximum allowed size.
InvalidFileType(String)
The uploaded file has a disallowed MIME type.
Io(Error)
An I/O error occurred during file upload processing.
Upload(String)
A general upload error occurred.
ChecksumMismatch
The file checksum does not match the expected value.
MimeDetectionFailed
The MIME type of the uploaded file could not be detected.
PathTraversal
The filename contains path traversal sequences (e.g., ../).
Trait Implementations§
Source§impl Debug for FileUploadError
impl Debug for FileUploadError
Source§impl Display for FileUploadError
impl Display for FileUploadError
Source§impl Error for FileUploadError
impl Error for FileUploadError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Auto Trait Implementations§
impl !RefUnwindSafe for FileUploadError
impl !UnwindSafe for FileUploadError
impl Freeze for FileUploadError
impl Send for FileUploadError
impl Sync for FileUploadError
impl Unpin for FileUploadError
impl UnsafeUnpin for FileUploadError
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