#[non_exhaustive]pub enum DecodeError {
Expected(&'static str),
UnknownKey(String),
DuplicateKey(String),
MissingField(&'static str),
Source(SourceError),
}Expand description
Why a typed target refused what it was given.
Non-exhaustive, so a target can add refusals without a breaking change.
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.
Expected(&'static str)
The ciphertext holds something other than the named kind.
UnknownKey(String)
A map holds a key the target has no field for.
DuplicateKey(String)
A map holds the same key twice.
MissingField(&'static str)
A map is missing the named field.
Source(SourceError)
The source stopped the walk (only reachable through a passthrough).
Implementations§
Source§impl DecodeError
impl DecodeError
Sourcepub fn unknown_key(key: &str) -> Self
pub fn unknown_key(key: &str) -> Self
A map holds key, which the target has no field for.
Sourcepub fn duplicate_key(key: &str) -> Self
pub fn duplicate_key(key: &str) -> Self
A map holds key twice.
Trait Implementations§
Source§impl Debug for DecodeError
impl Debug for DecodeError
Source§impl Display for DecodeError
impl Display for DecodeError
Source§impl Error for DecodeError
impl Error for DecodeError
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 Error for DecodeError
impl Error for DecodeError
Source§fn source(error: SourceError) -> Self
fn source(error: SourceError) -> Self
Wrap a failure that came from the source, not the sink.
Auto Trait Implementations§
impl !RefUnwindSafe for DecodeError
impl !UnwindSafe for DecodeError
impl Freeze for DecodeError
impl Send for DecodeError
impl Sync for DecodeError
impl Unpin for DecodeError
impl UnsafeUnpin for DecodeError
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