pub enum ErrorKind {
MissingField {
field_name: String,
},
UnknownField {
field_name: String,
},
TypeMismatch {
expected: String,
found: String,
},
InvalidEnumVariant {
enum_name: String,
variant: String,
valid: Vec<String>,
},
InvalidOptionValue {
expected: String,
found: String,
},
InvalidListElement {
index: usize,
expected: String,
found: String,
},
ExpectedStruct {
found: String,
},
ExpectedList {
found: String,
},
ExpectedOption {
found: String,
},
}Expand description
Specific kinds of validation errors produced when RON data does not match a schema.
Variants§
MissingField
A required field defined in the schema is absent from the data.
UnknownField
The data contains a field not defined in the schema.
TypeMismatch
A value exists but has the wrong type.
Fields
InvalidEnumVariant
A bare identifier does not match any variant of the expected enum.
Fields
InvalidOptionValue
The value inside Some(...) has the wrong type.
Fields
InvalidListElement
A list element has the wrong type.
Fields
ExpectedStruct
Expected a struct (...) but found a non-struct value.
ExpectedList
Expected a list [...] but found a non-list value.
ExpectedOption
Expected Some(...) or None but found something else.
Trait Implementations§
impl Eq for ErrorKind
impl StructuralPartialEq for ErrorKind
Auto Trait Implementations§
impl Freeze for ErrorKind
impl RefUnwindSafe for ErrorKind
impl Send for ErrorKind
impl Sync for ErrorKind
impl Unpin for ErrorKind
impl UnsafeUnpin for ErrorKind
impl UnwindSafe for ErrorKind
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