pub struct UnknownVariant {
pub expected: &'static str,
pub found: String,
}Expand description
A wire or storage string that names no variant of a closed enum.
The Closed Enum Contract’s third rule forbids mapping such a value onto a
known variant, so every decoder in this crate refuses by name and hands
the offending spelling back for the caller to report. An Unknown(String)
variant would be the other permitted answer; a refusal is chosen because
these values reach authorization and outcome reporting, where carrying an
uninterpretable value forward is worse than stopping.
Fields§
§expected: &'static strThe enum the value was being decoded into.
found: StringThe value as it arrived, so the report names it.
Trait Implementations§
Source§impl Clone for UnknownVariant
impl Clone for UnknownVariant
Source§impl Debug for UnknownVariant
impl Debug for UnknownVariant
Source§impl Display for UnknownVariant
impl Display for UnknownVariant
impl Eq for UnknownVariant
Source§impl Error for UnknownVariant
impl Error for UnknownVariant
1.30.0 · 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 PartialEq for UnknownVariant
impl PartialEq for UnknownVariant
impl StructuralPartialEq for UnknownVariant
Auto Trait Implementations§
impl Freeze for UnknownVariant
impl RefUnwindSafe for UnknownVariant
impl Send for UnknownVariant
impl Sync for UnknownVariant
impl Unpin for UnknownVariant
impl UnsafeUnpin for UnknownVariant
impl UnwindSafe for UnknownVariant
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.