Enum JsonRejection

#[non_exhaustive]
pub enum JsonRejection

Rejection used for Json.

Contains one variant for each way the Json extractor can fail.

Variants

JsonDataError(JsonDataError)
JsonSyntaxError(JsonSyntaxError)
MissingJsonContentType(MissingJsonContentType)
BytesRejection(BytesRejection)

Implementations

impl JsonRejection

fn body_text(&self) -> String

Get the response body text used for this rejection.

fn status(&self) -> StatusCode

Get the status code used for this rejection.

Trait Implementations

impl Debug for JsonRejection

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

impl Display for JsonRejection

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

impl Error for JsonRejection

fn source(&self) -> Option<&dyn Error + 'static>

impl From<BytesRejection> for JsonRejection

fn from(inner: BytesRejection) -> Self

impl From<JsonDataError> for JsonRejection

fn from(inner: JsonDataError) -> Self

impl From<JsonSyntaxError> for JsonRejection

fn from(inner: JsonSyntaxError) -> Self

impl From<MissingJsonContentType> for JsonRejection

fn from(inner: MissingJsonContentType) -> Self

impl IntoResponse for JsonRejection

fn into_response(self) -> Response

Auto Trait Implementations

impl !RefUnwindSafe for JsonRejection

impl !UnwindSafe for JsonRejection

impl Freeze for JsonRejection

impl Send for JsonRejection

impl Sync for JsonRejection

impl Unpin for JsonRejection

impl UnsafeUnpin for JsonRejection

Blanket Implementations

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for JsonRejection where ST: ?Sized, DT: ?Sized,

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for JsonRejection where ST: ?Sized, DT: ?Sized,

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

fn type_id(&self) -> TypeId

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

fn borrow(&self) -> &T

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

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

impl<T> From<T> for JsonRejection

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> Instrument for JsonRejection

impl<T> Read<Exclusive, BecauseExclusive> for JsonRejection where T: ?Sized,

impl<T> Same for JsonRejection

type Output = T;

impl<T> ToString for JsonRejection where T: Display + ?Sized,

fn to_string(&self) -> String

impl<T> WithSubscriber for JsonRejection

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

fn into(self) -> U

Calls U::from(self).

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

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

type Error = never;
fn try_from(value: U) -> Result<T, never>

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

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

impl<V, T> VZip<V> for JsonRejection where V: MultiLane<T>,

fn vzip(self) -> V