Enum serde_json::error::Error [] [src]

pub enum Error {
    Syntax(ErrorCode, usize, usize),
    Io(Error),
    FromUtf8(FromUtf8Error),
}

This type represents all possible errors that can occur when serializing or deserializing a value into JSON.

Variants

Syntax

The JSON value had some syntatic error.

Io

Some IO error occurred when serializing or deserializing a value.

FromUtf8

Some UTF8 error occurred while serializing or deserializing a value.

Trait Implementations

impl Error for Error

fn description(&self) -> &str

fn cause(&self) -> Option<&Error>

impl Display for Error

fn fmt(&self, fmt: &mut Formatter) -> Result

impl From<Error> for Error

fn from(error: Error) -> Error

impl From<FromUtf8Error> for Error

fn from(error: FromUtf8Error) -> Error

impl From<Error> for Error

fn from(error: Error) -> Error

impl Error for Error

fn custom<T: Into<String>>(msg: T) -> Error

fn end_of_stream() -> Error

fn invalid_type(ty: Type) -> Error

fn invalid_value(msg: &str) -> Error

fn invalid_length(len: usize) -> Error

fn unknown_variant(variant: &str) -> Error

fn unknown_field(field: &str) -> Error

fn missing_field(field: &'static str) -> Error

impl Error for Error

fn custom<T: Into<String>>(msg: T) -> Error

Raised when there is general error when deserializing a type.

fn invalid_value(msg: &str) -> Self

Derived Implementations

impl Debug for Error

fn fmt(&self, __arg_0: &mut Formatter) -> Result