serde_json 0.5.1

A JSON serialization file format
1
2
3
4
5
6
7
8
9
10
11
12
13
b0VIM 7.4��U���d�ericktErick-Tryzelaar-MBP.local~erickt/projects/rust/serde/serde/serde_json/src/error.rs
3210#"! UtpVgWad{V�������x\G.������jS4�
�
�
�
�
w
a
<
"

��������a&	��B�
�
K

�	{	,	��B��c�h'��E��$��D��K��������{z    SyntaxError(ErrorCode, usize, usize),    /// msg, line, colpub enum Error {#[derive(Debug)]}    }        }            ErrorCode::UnrecognizedHex => "invalid \\u escape (unrecognized hex)".fmt(f),            ErrorCode::UnknownVariant => "unknown variant".fmt(f),            //ErrorCode::UnexpectedName(ref name) => write!(f, "unexpected name {}", name),            ErrorCode::UnexpectedEndOfHexEscape => "unexpected end of hex escape".fmt(f),            ErrorCode::TrailingCharacters => "trailing characters".fmt(f),            ErrorCode::NotUtf8 => "contents not utf-8".fmt(f),            ErrorCode::NotFourDigit => "invalid \\u escape (not four digits)".fmt(f),            ErrorCode::MissingField(ref field) => write!(f, "missing field \"{}\"", field),            ErrorCode::UnknownField(ref field) => write!(f, "unknown field \"{}\"", field),            ErrorCode::LoneLeadingSurrogateInHexEscape => "lone leading surrogate in hex escape".fmt(f),            ErrorCode::KeyMustBeAString => "key must be a string".fmt(f),            ErrorCode::InvalidUnicodeCodePoint => "invalid unicode code point".fmt(f),            ErrorCode::InvalidNumber => "invalid number".fmt(f),            ErrorCode::InvalidEscape => "invalid escape".fmt(f),            //ErrorCode::ExpectedTokens(ref token, tokens) => write!(f, "expected {}, found {}", tokens, token),            ErrorCode::ExpectedSomeValue => "expected value".fmt(f),            ErrorCode::ExpectedSomeIdent => "expected ident".fmt(f),            ErrorCode::ExpectedObjectCommaOrEnd => "expected `,` or `}`".fmt(f),            ErrorCode::ExpectedName => "expected name".fmt(f),            ErrorCode::ExpectedListCommaOrEnd => "expected `,` or `]`".fmt(f),            ErrorCode::ExpectedEnumVariantString => "expected variant".fmt(f),            ErrorCode::ExpectedEnumToken => "expected enum token".fmt(f),            ErrorCode::ExpectedEnumMapStart => "expected enum map start".fmt(f),            ErrorCode::ExpectedEnumEndToken => "expected enum map end".fmt(f),            ErrorCode::ExpectedEnumEnd => "expected enum end".fmt(f),            ErrorCode::ExpectedConversion => "expected conversion".fmt(f),            ErrorCode::ExpectedColon => "expected `:`".fmt(f),            ErrorCode::EOFWhileParsingValue => "EOF While parsing value".fmt(f),            ErrorCode::EOFWhileParsingString => "EOF While parsing string".fmt(f),            ErrorCode::EOFWhileParsingObject => "EOF While parsing object".fmt(f),            ErrorCode::EOFWhileParsingList => "EOF While parsing list".fmt(f),            //ErrorCode::ConversionError(ref token) => write!(f, "failed to convert {}", token),        match *self {        use std::fmt::Debug;    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {impl fmt::Debug for ErrorCode {}    UnrecognizedHex,    UnknownVariant,    UnexpectedEndOfHexEscape,    TrailingCharacters,    NotUtf8,    NotFourDigit,    MissingField(&'static str),    UnknownField(String),    LoneLeadingSurrogateInHexEscape,    KeyMustBeAString,    InvalidUnicodeCodePoint,    InvalidNumber,    InvalidEscape,    ExpectedSomeValue,    ExpectedSomeIdent,    ExpectedObjectCommaOrEnd,    ExpectedName,    ExpectedListCommaOrEnd,    ExpectedEnumVariantString,    ExpectedEnumToken,    ExpectedEnumMapStart,    ExpectedEnumEndToken,    ExpectedEnumEnd,    ExpectedConversion,    ExpectedColon,    EOFWhileParsingValue,    EOFWhileParsingString,    EOFWhileParsingObject,    EOFWhileParsingList,pub enum ErrorCode {#[derive(Clone, PartialEq)]/// The errors that can arise while parsing a JSON stream.use serde::de;use std::result;use std::io;use std::fmt;use std::error;ad�vg������jca`B��x8)�
�
�
�
�

~
O
9

�������}g.���@�
�
�
�
o
a
R

�	�	�	�	�	�	�	�	b	D	>	<	;		���WI���WI
�������@:9����TNM�����vupub type Result<T> = result::Result<T, Error>;/// Helper alias for `Result` objects that return a JSON `Error`.}    }        Error::MissingFieldError(field)    fn missing_field(field: &'static str) -> Error {    }        Error::SyntaxError(ErrorCode::UnknownField(field.to_string()), 0, 0)    fn unknown_field(field: &str) -> Error {    }        Error::SyntaxError(ErrorCode::EOFWhileParsingValue, 0, 0)    fn end_of_stream() -> Error {    }        Error::SyntaxError(ErrorCode::ExpectedSomeValue, 0, 0)    fn syntax(_: &str) -> Error {impl de::Error for Error {}    }        }            }                de::Error::missing_field(field)            de::value::Error::MissingFieldError(field) => {            }                Error::SyntaxError(ErrorCode::UnknownField(field), 0, 0)            de::value::Error::UnknownFieldError(field) => {            }                de::Error::end_of_stream()            de::value::Error::EndOfStreamError => {            }                Error::SyntaxError(ErrorCode::ExpectedSomeValue, 0, 0)            de::value::Error::SyntaxError => {        match error {    fn from(error: de::value::Error) -> Error {impl From<de::value::Error> for Error {}    }        Error::IoError(error)    fn from(error: io::Error) -> Error {impl From<io::Error> for Error {}    }        }            */            }                Some(format!("unknown variant {}", variant))            Error::UnknownVariantError(ref variant) => {            /*            }                write!(fmt, "missing field {}", field)            Error::MissingFieldError(ref field) => {            */            }                Some(format!("expected {}, found {}", expected, found))            Error::ExpectedError(ref expected, ref found) => {            /*            Error::IoError(ref error) => fmt::Display::fmt(error, fmt),            }                write!(fmt, "{:?} at line {} column {}", code, line, col)            Error::SyntaxError(ref code, line, col) => {        match *self {    fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {impl fmt::Display for Error {}    }        }            _ => None,            Error::IoError(ref error) => Some(error),        match *self {    fn cause(&self) -> Option<&error::Error> {    }        }            */            Error::UnknownVariantError(_) => "unknown variant",            /*            Error::MissingFieldError(_) => "missing field",            */            Error::ExpectedError(ref expected, _) => &expected,            /*            Error::IoError(ref error) => error::Error::description(error),            Error::SyntaxError(..) => "syntax error",        match *self {    fn description(&self) -> &str {impl error::Error for Error {}    */    UnknownVariantError(String),    /*    MissingFieldError(&'static str),    */    ExpectedError(String, String),    /*    IoError(io::Error),