#[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

Fields

field_name: Option<String>

An unknown field is detected when multipart constraints are added.

IncompleteFieldData

Fields

field_name: Option<String>

The field data is found incomplete.

IncompleteHeaders

Couldn’t read the field headers completely.

ReadHeaderFailed(Error)

Failed to read headers.

DecodeHeaderName

Fields

name: String
cause: Box<dyn Error + Send + Sync>

Failed to decode the field’s raw header name to HeaderName type.

DecodeHeaderValue

Fields

value: Vec<u8>
cause: Box<dyn Error + Send + Sync>

Failed to decode the field’s raw header value to HeaderValue type.

IncompleteStream

Multipart stream is incomplete.

FieldSizeExceeded

Fields

limit: u64
field_name: Option<String>

The incoming field size exceeded the maximum limit.

StreamSizeExceeded

Fields

limit: u64

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

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

The lower-level source of this error, if any. Read more

🔬 This is a nightly-only experimental API. (backtrace)

Returns a stack backtrace, if available, of where this error occurred. Read more

👎 Deprecated since 1.42.0:

use the Display impl or to_string()

👎 Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.