Enum StringRejection

#[non_exhaustive]
pub enum StringRejection

Rejection used for String.

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

Variants

FailedToBufferBody(FailedToBufferBody)
InvalidUtf8(InvalidUtf8)

Implementations

impl StringRejection

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 StringRejection

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

impl Display for StringRejection

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

impl Error for StringRejection

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

impl From<FailedToBufferBody> for StringRejection

fn from(inner: FailedToBufferBody) -> Self

impl From<InvalidUtf8> for StringRejection

fn from(inner: InvalidUtf8) -> Self

impl IntoResponse for StringRejection

fn into_response(self) -> Response

Auto Trait Implementations

impl !RefUnwindSafe for StringRejection

impl !UnwindSafe for StringRejection

impl Freeze for StringRejection

impl Send for StringRejection

impl Sync for StringRejection

impl Unpin for StringRejection

impl UnsafeUnpin for StringRejection

Blanket Implementations

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

fn type_id(&self) -> TypeId

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

fn borrow(&self) -> &T

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

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

impl<T> From<T> for StringRejection

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> Instrument for StringRejection

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

fn to_string(&self) -> String

impl<T> WithSubscriber for StringRejection

impl<T, U> Into<U> for StringRejection 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 StringRejection where U: Into<T>,

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

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

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