Enum DatapackDecodeError
#[non_exhaustive]pub enum DatapackDecodeError {
Malformed(String),
NotAnObject,
MissingField {
field: String,
},
UnknownField {
field: String,
},
WrongType {
field: String,
expected: &'static str,
},
OutOfRange {
field: String,
},
TooLong {
field: String,
},
InvalidIdentifier {
field: String,
},
}Expand description
Why an entry file did not decode. field names the offending JSON key.
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.
Malformed(String)
The file is not JSON.
NotAnObject
The JSON is not an object.
MissingField
A required field is absent.
UnknownField
A key the schema does not declare.
WrongType
A value of the wrong JSON type.
OutOfRange
A number outside the field’s bounds.
TooLong
A string over the field’s max_len.
InvalidIdentifier
An id that does not parse.
Trait Implementations§
§impl Clone for DatapackDecodeError
impl Clone for DatapackDecodeError
§fn clone(&self) -> DatapackDecodeError
fn clone(&self) -> DatapackDecodeError
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read more§impl Debug for DatapackDecodeError
impl Debug for DatapackDecodeError
impl Eq for DatapackDecodeError
§impl PartialEq for DatapackDecodeError
impl PartialEq for DatapackDecodeError
impl StructuralPartialEq for DatapackDecodeError
Auto Trait Implementations§
impl Freeze for DatapackDecodeError
impl RefUnwindSafe for DatapackDecodeError
impl Send for DatapackDecodeError
impl Sync for DatapackDecodeError
impl Unpin for DatapackDecodeError
impl UnsafeUnpin for DatapackDecodeError
impl UnwindSafe for DatapackDecodeError
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