Enum serde_hjson::error::Error
source · [−]pub enum Error {
Syntax(ErrorCode, usize, usize),
Io(Error),
FromUtf8(FromUtf8Error),
}
Expand description
This type represents all possible errors that can occur when serializing or deserializing a value into JSON.
Variants
Syntax(ErrorCode, usize, usize)
The JSON value had some syntatic error.
Io(Error)
Some IO error occurred when serializing or deserializing a value.
FromUtf8(FromUtf8Error)
Some UTF8 error occurred while serializing or deserializing a value.
Trait Implementations
sourceimpl Error for Error
impl Error for Error
sourcefn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
sourcefn cause(&self) -> Option<&dyn Error>
fn cause(&self) -> Option<&dyn Error>
replaced by Error::source, which can support downcasting
sourceimpl Error for Error
impl Error for Error
sourcefn custom<T: Into<String>>(msg: T) -> Error
fn custom<T: Into<String>>(msg: T) -> Error
Raised when there is general error when deserializing a type.
sourcefn end_of_stream() -> Error
fn end_of_stream() -> Error
Raised when a Deserialize
type unexpectedly hit the end of the stream.
sourcefn invalid_type(ty: Type) -> Error
fn invalid_type(ty: Type) -> Error
Raised when a Deserialize
was passed an incorrect type.
sourcefn invalid_value(msg: &str) -> Error
fn invalid_value(msg: &str) -> Error
Raised when a Deserialize
was passed an incorrect value.
sourcefn invalid_length(len: usize) -> Error
fn invalid_length(len: usize) -> Error
Raised when a fixed sized sequence or map was passed in the wrong amount of arguments. Read more
sourcefn unknown_variant(variant: &str) -> Error
fn unknown_variant(variant: &str) -> Error
Raised when a Deserialize
enum type received an unexpected variant.
sourcefn unknown_field(field: &str) -> Error
fn unknown_field(field: &str) -> Error
Raised when a Deserialize
struct type received an unexpected struct field.
sourcefn missing_field(field: &'static str) -> Error
fn missing_field(field: &'static str) -> Error
raised when a deserialize
struct type did not receive a field.
sourcefn duplicate_field(field: &'static str) -> Self
fn duplicate_field(field: &'static str) -> Self
Raised when a Deserialize
struct type received more than one of the
same struct field. Read more
sourceimpl From<FromUtf8Error> for Error
impl From<FromUtf8Error> for Error
sourcefn from(error: FromUtf8Error) -> Error
fn from(error: FromUtf8Error) -> Error
Converts to this type from the input type.
Auto Trait Implementations
impl !RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl !UnwindSafe for Error
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more