#[non_exhaustive]pub enum Fault {
Syntax {
detail: String,
},
DuplicateKey {
key: String,
},
MergeKey,
Limit {
name: &'static str,
value: String,
raise: Raise,
},
TooLarge {
bytes: u64,
limit: u64,
raise: Raise,
},
ExpectedKind {
expected: String,
found: String,
},
InvalidValue {
detail: String,
},
UnknownField {
field: String,
expected: Vec<&'static str>,
},
UnknownVariant {
variant: String,
expected: Vec<&'static str>,
},
MissingField {
field: &'static str,
},
}json or toml or yaml only.Expand description
What a read of a text or of a typed value found wrong.
Each variant is one problem type, and Messages words it.
A problem in a node an alias replayed is a Refusal with
Refusal::defined_at set, not a variant of its own.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Syntax
The text is not valid in the format.
DuplicateKey
A key written twice in one mapping: under Reading::Strict in YAML
and JSON, and under either reading in TOML, whose syntax forbids it.
MergeKey
A YAML merge key (<<), under Reading::Strict.
Limit
The text went past a limit.
Fields
TooLarge
The whole text is longer than max_reader_input_bytes allows.
Fields
ExpectedKind
A node of another kind than the type being read needs, such as a sequence where a struct is read.
Fields
InvalidValue
A value the type refuses: a scalar the format cannot read as the type
the field needs, a number out of range, or the text of an error the
type’s own Deserialize raised.
UnknownField
A key a struct does not have, under deny_unknown_fields.
UnknownVariant
A variant an enum does not have.
Fields
MissingField
A field a struct needs and its mapping lacks.
Implementations§
Trait Implementations§
impl Eq for Fault
impl StructuralPartialEq for Fault
Auto Trait Implementations§
impl Forget for Fault
impl Freeze for Fault
impl Move for Fault
impl RefUnwindSafe for Fault
impl Send for Fault
impl Sync for Fault
impl Unpin for Fault
impl UnsafeUnpin for Fault
impl UnwindSafe for Fault
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T, O> Matches<O> for Twhere
T: PartialEq<O>,
impl<T, O> Matches<O> for Twhere
T: PartialEq<O>,
fn validate_matches(&self, other: &O) -> bool
Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
CompactString. Read more