#[non_exhaustive]pub enum Error {
Show 14 variants
UnknownField {
field_name: Option<String>,
},
IncompleteFieldData {
field_name: Option<String>,
},
IncompleteHeaders,
ReadHeaderFailed(Error),
DecodeHeaderName {
name: String,
cause: Box<dyn Error + Send + Sync>,
},
DecodeHeaderValue {
value: Vec<u8>,
cause: Box<dyn Error + Send + Sync>,
},
IncompleteStream,
FieldSizeExceeded {
limit: u64,
field_name: Option<String>,
},
StreamSizeExceeded {
limit: u64,
},
StreamReadFailed(Box<dyn Error + Send + Sync>),
LockFailure,
NoMultipart,
DecodeContentType(FromStrError),
NoBoundary,
}
Expand description
A set of errors that can occur during parsing multipart stream and in other 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.
UnknownField
An unknown field is detected when multipart
constraints
are added.
IncompleteFieldData
The field data is found incomplete.
IncompleteHeaders
Couldn’t read the field headers completely.
ReadHeaderFailed(Error)
Failed to read headers.
DecodeHeaderName
Failed to decode the field’s raw header name to
HeaderName
type.
DecodeHeaderValue
Failed to decode the field’s raw header value to
HeaderValue
type.
IncompleteStream
Multipart stream is incomplete.
FieldSizeExceeded
The incoming field size exceeded the maximum limit.
StreamSizeExceeded
The incoming stream size exceeded the maximum limit.
StreamReadFailed(Box<dyn Error + Send + Sync>)
Stream read failed.
LockFailure
Failed to lock the multipart shared state for any changes.
NoMultipart
The Content-Type
header is not multipart/form-data
.
DecodeContentType(FromStrError)
Failed to convert the Content-Type
to mime::Mime
type.
NoBoundary
No boundary found in Content-Type
header.
Trait Implementations§
source§impl Error for Error
impl Error for Error
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
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()
source§impl PartialEq<Error> for Error
impl PartialEq<Error> for Error
impl Eq for Error
Auto Trait Implementations§
impl !RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl !UnwindSafe for Error
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