#[non_exhaustive]pub enum Category {
Io,
Syntax,
TypeUnmatched,
NotFound,
Eof,
}Expand description
Categorizes the cause of a sonic_rs::Error.
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.
Io
The error was caused by a failure to read or write bytes on an I/O stream.
Syntax
The error was caused by input that was not syntactically valid JSON.
TypeUnmatched
The error was caused when the input data is unmatched for expected type.
For example, JSON containing a number when the type being deserialized into holds a String.
NotFound
The error was caused when the target field was not found from JSON.
For example:
When using get* APIs, it gets a unknown keys from JSON text, or get
a index out of the array.
Eof
The error was caused by prematurely reaching the end of the input data.
Callers that process streaming input may be interested in retrying the deserialization once more data is available.
Trait Implementations§
impl Copy for Category
impl Eq for Category
impl StructuralPartialEq for Category
Auto Trait Implementations§
impl Freeze for Category
impl RefUnwindSafe for Category
impl Send for Category
impl Sync for Category
impl Unpin for Category
impl UnwindSafe for Category
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