pub enum CborRejection {
MissingCborContentType,
FailedToParseCbor,
BytesRejection(BytesRejection),
}Expand description
Rejection type for CBOR extraction failures.
This enum represents the various ways that CBOR extraction can fail.
It implements IntoResponse to provide appropriate HTTP responses for each error type.
Variants§
MissingCborContentType
The request is missing the required Content-Type: application/cbor header.
FailedToParseCbor
Failed to parse the request body as valid CBOR.
BytesRejection(BytesRejection)
Failed to read the request body bytes.
Trait Implementations§
Source§impl Debug for CborRejection
impl Debug for CborRejection
Source§impl Display for CborRejection
impl Display for CborRejection
Source§impl Error for CborRejection
impl Error for CborRejection
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§impl From<BytesRejection> for CborRejection
impl From<BytesRejection> for CborRejection
Source§fn from(source: BytesRejection) -> Self
fn from(source: BytesRejection) -> Self
Converts to this type from the input type.
Source§impl IntoResponse for CborRejection
impl IntoResponse for CborRejection
Source§fn into_response(self) -> Response
fn into_response(self) -> Response
Create a response.
Auto Trait Implementations§
impl Freeze for CborRejection
impl !RefUnwindSafe for CborRejection
impl Send for CborRejection
impl Sync for CborRejection
impl Unpin for CborRejection
impl !UnwindSafe for CborRejection
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
Mutably borrows from an owned value. Read more
Source§impl<T> InitializeFromFunction<T> for T
impl<T> InitializeFromFunction<T> for T
Source§fn initialize_from_function(f: fn() -> T) -> T
fn initialize_from_function(f: fn() -> T) -> T
Create an instance of this type from an initialization function
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> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<Ret> SpawnIfAsync<(), Ret> for Ret
impl<Ret> SpawnIfAsync<(), Ret> for Ret
Source§impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
Source§fn super_from(input: T) -> O
fn super_from(input: T) -> O
Convert from a type to another type.
Source§impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
Source§fn super_into(self) -> O
fn super_into(self) -> O
Convert from a type to another type.
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.