#[non_exhaustive]pub enum MultipartError {
Show 15 variants
    ContentTypeMissing,
    ContentTypeParse,
    ContentTypeIncompatible,
    BoundaryMissing,
    ContentDispositionMissing,
    ContentDispositionNameMissing,
    Nested,
    Incomplete,
    Parse(ParseError),
    Payload(PayloadError),
    NotConsumed,
    Field {
        name: String,
        source: Error,
    },
    DuplicateField(String),
    MissingField(String),
    UnknownField(String),
}Expand description
A set of errors that can occur during parsing multipart streams.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
ContentTypeMissing
Could not find Content-Type header.
ContentTypeParse
Could not parse Content-Type header.
ContentTypeIncompatible
Parsed Content-Type did not have “multipart” top-level media type.
Also raised when extracting a MultipartForm from a request that does not have the
“multipart/form-data” media type.
BoundaryMissing
Multipart boundary is not found.
ContentDispositionMissing
Content-Disposition header was not found or not of disposition type “form-data” when parsing a “form-data” field.
As per RFC 7578 §4.2, a “multipart/form-data” field’s Content-Disposition header must always be present and have a disposition type of “form-data”.
ContentDispositionNameMissing
Content-Disposition name parameter was not found when parsing a “form-data” field.
As per RFC 7578 §4.2, a “multipart/form-data” field’s Content-Disposition header must always include a “name” parameter.
Nested
Nested multipart is not supported.
Incomplete
Multipart stream is incomplete.
Parse(ParseError)
Field parsing failed.
Payload(PayloadError)
HTTP payload error.
NotConsumed
Stream is not consumed.
Field
Form field handler raised error.
DuplicateField(String)
Duplicate field found (for structure that opted-in to denying duplicate fields).
MissingField(String)
Required field is missing.
UnknownField(String)
Unknown field (for structure that opted-in to denying unknown fields).
Trait Implementations§
Source§impl Error for Error
 
impl Error for Error
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
 
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
 
fn description(&self) -> &str
Source§impl From<ParseError> for Error
 
impl From<ParseError> for Error
Source§fn from(original: ParseError) -> Error
 
fn from(original: ParseError) -> Error
Source§impl From<PayloadError> for Error
 
impl From<PayloadError> for Error
Source§fn from(original: PayloadError) -> Error
 
fn from(original: PayloadError) -> Error
Source§impl ResponseError for Error
Return BadRequest for MultipartError.
 
impl ResponseError for Error
Return BadRequest for MultipartError.
Source§fn status_code(&self) -> StatusCode
 
fn status_code(&self) -> StatusCode
Source§fn error_response(&self) -> HttpResponse
 
fn error_response(&self) -> HttpResponse
Auto Trait Implementations§
impl !Freeze for Error
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
Source§impl<T> Instrument for T
 
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
 
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
 
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
 
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
 
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
 
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more