Skip to main content

ReadErrorKind

Enum ReadErrorKind 

Source
#[non_exhaustive]
pub enum ReadErrorKind<B, S> { InvalidMediaType, ContentTooLarge { length: u64, limit: u64, }, Rejected(Rejection), Body(B), Store(S), }
Expand description

The kind of ReadError, where B is the body’s error and S the UploadStore’s.

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.
§

InvalidMediaType

The request has more than one Content-Type field, or one that is not a valid media type. The body was not read. 400 Bad Request.

§

ContentTooLarge

The request’s length exceeds the largest body the declaration could need in its format. The body was not read. 413 Content Too Large.

Fields

§length: u64

The request’s length, from its body or its Content-Length.

§limit: u64

The largest body the declaration could need, Content::body_size_limit.

§

Rejected(Rejection)

The content was refused: a fatal error, whose own status is 400, 413, or 415, or violations, which are 422 Unprocessable Content.

§

Body(B)

Reading the request’s body failed, including when its read was cancelled. 400 Bad Request, although after cancellation, such as when the server is shutting down, there is usually no one to respond to.

§

Store(S)

Storing an upload failed, including when a store operation was cancelled. 500 Internal Server Error.

Trait Implementations§

Source§

impl<B: Debug, S: Debug> Debug for ReadErrorKind<B, S>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<B, S> Forget for ReadErrorKind<B, S>

§

impl<B, S> Freeze for ReadErrorKind<B, S>
where B: Freeze, S: Freeze,

§

impl<B, S> RefUnwindSafe for ReadErrorKind<B, S>

§

impl<B, S> Send for ReadErrorKind<B, S>
where B: Send, S: Send,

§

impl<B, S> Sync for ReadErrorKind<B, S>
where B: Sync, S: Sync,

§

impl<B, S> Unpin for ReadErrorKind<B, S>
where B: Unpin, S: Unpin,

§

impl<B, S> UnsafeUnpin for ReadErrorKind<B, S>
where B: UnsafeUnpin, S: UnsafeUnpin,

§

impl<B, S> UnwindSafe for ReadErrorKind<B, S>
where B: UnwindSafe, S: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.