pub enum ErrorKind {
Show 16 variants
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,
},
ExpectedMap {
found: String,
},
InvalidMapKey {
key: String,
expected: String,
found: String,
},
InvalidMapValue {
key: String,
expected: String,
found: String,
},
InvalidVariantData {
enum_name: String,
variant: String,
expected: String,
found: String,
},
ExpectedTuple {
found: String,
},
TupleLengthMismatch {
expected: usize,
found: usize,
},
InvalidTupleElement {
index: usize,
expected: String,
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.
ExpectedMap
Expected a map { ... } but found a non-map value.
InvalidMapKey
A map key has the wrong type.
Fields
InvalidMapValue
A map value has the wrong type.
Fields
InvalidVariantData
An enum variant’s associated data does not match the expected type.
Fields
ExpectedTuple
Expected a tuple (...) but found a non-tuple value.
TupleLengthMismatch
A tuple has the wrong number of elements.
Fields
InvalidTupleElement
A tuple element has the wrong type.