Struct aws_smithy_cbor::decode::DeserializeError
source · pub struct DeserializeError { /* private fields */ }
Expand description
When any of the decode methods are called they look for that particular data type at the current
position. If the CBOR data tag does not match the type, a DeserializeError
is returned.
Implementations§
source§impl DeserializeError
impl DeserializeError
sourcepub fn unexpected_union_variant(unexpected_type: Type, at: usize) -> Self
pub fn unexpected_union_variant(unexpected_type: Type, at: usize) -> Self
More than one union variant was detected: unexpected_type
was unexpected.
sourcepub fn unknown_union_variant(variant_name: &str, at: usize) -> Self
pub fn unknown_union_variant(variant_name: &str, at: usize) -> Self
Unknown union variant was detected. Servers reject unknown union varaints.
sourcepub fn mixed_union_variants(at: usize) -> Self
pub fn mixed_union_variants(at: usize) -> Self
More than one union variant was detected, but we never even got to parse the first one. We immediately raise this error when detecting a union serialized as a fixed-length CBOR map whose length (specified upfront) is a value different than 1.
sourcepub fn expected_end_of_stream(at: usize) -> Self
pub fn expected_end_of_stream(at: usize) -> Self
Expected end of stream but more data is available.
sourcepub fn custom(message: impl Into<Cow<'static, str>>, at: usize) -> Self
pub fn custom(message: impl Into<Cow<'static, str>>, at: usize) -> Self
Returns a custom error with an offset.
sourcepub fn is_type_mismatch(&self) -> bool
pub fn is_type_mismatch(&self) -> bool
An unexpected type was encountered.
Trait Implementations§
source§impl Debug for DeserializeError
impl Debug for DeserializeError
source§impl Display for DeserializeError
impl Display for DeserializeError
source§impl Error for DeserializeError
impl Error for DeserializeError
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
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()
Auto Trait Implementations§
impl Freeze for DeserializeError
impl RefUnwindSafe for DeserializeError
impl Send for DeserializeError
impl Sync for DeserializeError
impl Unpin for DeserializeError
impl UnwindSafe for DeserializeError
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more