b0VIM 7.4 V~�Uy���� erickt Erick-Tryzelaar-MBP.local ~erickt/projects/rust/serde/json/json/src/error.rs utf-8
3210 #"! U tp W N ^ ad * ^ � � � o n ^ � � � W ; &
� � � � � } c I 2 �
�
�
�
�
�
s
V
@
� � � � � x c a ` @ � � � � / �
�
L
� l � � 3 � � ^ � � @ � � 1 � @ � � X � � � � � � � � � p K ) ' & � � � Error::SyntaxError(..) => "syntax error", match *self { fn description(&self) -> &str { impl error::Error for Error { } FromUtf8Error(FromUtf8Error), MissingFieldError(&'static str), IoError(io::Error), SyntaxError(ErrorCode, usize, usize), /// msg, line, col pub enum Error { #[derive(Debug)] } } } ErrorCode::UnrecognizedHex => "invalid \\u escape (unrecognized hex)".fmt(f), ErrorCode::UnknownVariant => "unknown variant".fmt(f), 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::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), 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)] /// Theuse std::error; //! `serde_json` errors. //! This module is centered around the `Error` and `ErrorCode` types, which represents all possible //! //! JSON Errors ad � � N � q g a ` 1 � � � � � � ~ ` #
�
�
|
4
� � � � � � � k e c b = � � � � � � u F �
�
�
�
�
H
� � � l ^ T N L K 0 � � � � d ^ ] 0 � � � � d ^ \ [ � � � � d c � � ppppub type Respub tppub type Result<T> = result::Result<T, Error>; /// Hpub type Result<Tpub type Result<T> = result::Result<T,ppppppppppppppub type Result<T> = result::Result<T, Error>; /// Hepub type Result<T> = result::Resupub pub pub type Result<T> = result::Result<T, Epub type Result<T> = result::Result<T, Error>; /// Helper alias for `Result` objects that return a JSON `Error`. } } Error::SyntaxError(ErrorCode::MissingField(field), 0, 0) fn missing_field(field: &'static str) -> Error { } Error::SyntaxError(ErrorCode::UnknownField(String::from(field)), 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 { } } } } Error::SyntaxError(ErrorCode::MissingField(field), 0, 0) 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::FromUtf8Error(error) fn from(error: FromUtf8Error) -> Error { impl From<FromUtf8Error> for Error { } } Error::IoError(error) fn from(error: io::Error) -> Error { impl From<io::Error> for Error { } } } Error::FromUtf8Error(ref error) => fmt::Display::fmt(error, fmt), 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::FromUtf8Error(ref error) => Some(error), Error::IoError(ref error) => Some(error), match *self { fn cause(&self) -> Option<&error::Error> { } } Error::FromUtf8Error(ref error) => error.description(), Error::IoError(ref error) => error::Error::description(error), ad , h � � � � � � � h Q 7 � � � � � t Z C $ �
�
�
�
�
�
g
Q
,
� � � � � � t r q Q � � � � @ �
�
]
� } , � � D � o * � � Q � B � � Q � i � � � � � � � � \ : 8 7 � � � � Erro Error::SyntaxError(..) => "syntax error", match *self { fn description(&self) -> &str { impl error::Error for Error { } FromUtf8Error(FromUtf8Error), MissingFieldError(&'static str), IoError(io::Error), SyntaxError(ErrorCode, usize, usize), /// msg, line, col pub enum Error { #[derive(Debug)] } } } ErrorCode::UnrecognizedHex => "invalid \\u escape (unrecognized hex)".fmt(f), ErrorCode::UnknownVariant => "unknown variant".fmt(f), 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::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), 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 { #[//##[allow(missing_docs)] /// The errors that can arise while parsing a JSON stream. use serde::de; use std::string::FromUtf8Error; use std::result; use std::io; use std::fmt; ad : n � � � � � n T : ' � � � � � t b D - �
�
�
�
~
^
L
?
'
� � � � � � e d N � � T �
y
3
� � I � � l � � P � n � M � � m � v l f d c � � � � � t \ 7 � � � � Error::SyntaxError(..) => "syntax error", match *self { fn description(&self) -> &str { impl error::Error for Error { } FromUtf8Error(FromUtf8Error), MissingFieldError(&'static str), IoError(io::Error), SyntaxError(ErrorCode, usize, usize), /// msg, line, col pub enum Error { #[derive(Debug)] #[allow(missing_docs)] /// value into JSON. /// This type represents all possible errors that can occur when serializing or deserializing a } } } ErrorCode::UnrecognizedHex => "invalid \\u escape (unrecognized hex)".fmt(f), ErrorCode::UnknownVariant => "unknown variant".fmt(f), 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::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 an object".fmt(f), ErrorCode::EOFWhileParsingList => "EOF while parsing a list".fmt(f), 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, /// EOF while parsing an object. EOFWhileParsingList, /// EOF while parsing a list. pub enum ErrorCode { #[derive(Clone, PartialEq)] ad � 2 � � � � � | b a 2 � � � � � x f H 1 �
�
�
�
�
b
P
C
+
� � � � � � i h R � V �
y
3
� � I � � l � � P � n � M � � m � v l f d c � � � � � t \ 7 � � � � Error::SyntaxError(..) => "syntax error", match *self { fn description(&self) -> &str { impl error::Error for Error { } FromUtf8Error(FromUtf8Error), MissingFieldError(&'static str), IoError(io::Error), SyntaxError(ErrorCode, usize, usize), /// msg, line, col pub enum Error { #[derive(Debug)] #[allow(missing_docs)] /// value into JSON. /// This type represents all possible errors that can occur when serializing or deserializing a } } } ErrorCode::UnrecognizedHex => "invalid \\u escape (unrecognized hex)".fmt(f), ErrorCode::UnknownVariant => "unknown variant".fmt(f), 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::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 a value".fmt(f), ErrorCode::EOFWhileParsingString => "EOF while parsing a string".fmt(f), ErrorCode::EOFWhileParsingObject => "EOF while parsing an object".fmt(f), ErrorCode::EOFWhileParsingList => "EOF while parsing a list".fmt(f), 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, Exp /// Expected this ch /// Expected this character to be a `':'`. EOFWhileParsingValue, /// EOF while parsing a JSON value. EOFWhileParsingString, /// EOF while parsing a string. EOFWhileParsingObject, ad # � W � � � � � Q 3 2 � � � � � � i V U = * ) �
�
�
�
�
~
Y
X
7
� � � � { z T 6 4 3 � � � � S �
�
U
� v 1 � � j � ` � ] � � � � � { j Y ) � � � � � N , * ) � � � � J I J Error::SyntaxE Error::SyntaxError(..) => "syntax error", match *self { Error::SyntaxError(..) => "syntax error", match *self { f Error::SyntaxE Error::SyntaxError(..) => "syntax Error::Sy Error::Synt Error: Error::SyntaxError(..) => "syn Error::SyntaxError(..) => Error::SyntaxError(..) => "syntax error", match *self { fn description(&self) -> &str { impl error::Error for Error { } FromUtf8Error(FromUtf8Error), /// Some UTF8 error occurred while serializing or deserializing a value. IoError(io::Error), /// Some IO error occurred when serializing or deserializing a value. SyntaxError(ErrorCode, usize, usize), /// The JSON value had some syntatic error. pub enum Error { #[derive(Debug)] /// value into JSON. /// This type represents all possible errors that can occur when serializing or deserializing a } } } ErrorCode::UnexpectedEndOfHexEscape => "unexpected end of hex escape".fmt(f), ErrorCode::TrailingCharacters => "trailing characters".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::ExpectedSomeValue => "expected value".fmt(f), ErrorCode::ExpectedSomeIdent => "expected ident".fmt(f), ErrorCode::ExpectedObjectCommaOrEnd => "expected `,` or `}`".fmt(f), ErrorCode::ExpectedListCommaOrEnd => "expected `,` or `]`".fmt(f), ErrorCode::ExpectedColon => "expected `:`".fmt(f), ErrorCode::EOFWhileParsingValue => "EOF while parsing a value".fmt(f), ErrorCode::EOFWhileParsingString => "EOF while parsing a string".fmt(f), ErrorCode::EOFWhileParsingObject => "EOF while parsing an object".fmt(f), ErrorCode::EOFWhileParsingList => "EOF while parsing a list".fmt(f), match *self { use std::fmt::Debug; fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { impl fmt::Debug for ErrorCode { } UnexpectedEndOfHexEscape, /// Unexpected end of hex excape. TrailingCharacters, /// JSON has non-whitespace trailing characters after the value. MissingField(&'static str), /// Struct is missing a field. UnknownField(String), /// Unknown field in struct. LoneLeadingSurrogateInHexEscape, /// Lone leading surrogate in hex escape. KeyMustBeAString, /// Object key is not a string. InvalidUnicodeCodePoint, /// Invalid unicode code point. InvalidNumber, /// Invalid number. InvalidEscape, /// Invalid hex escape code. ExpectedSomeValue, /// Expected this character to start a JSON value. ExpectedSomeIdent, /// Expected to parse either a `true`, `false`, or a `null`. ExpectedObjectCommaOrEnd, /// Expected this character to be either a `','` or a `}`. ExpectedListCommaOrEnd, /// Expected this character to be either a `','` or a `]`. ExpectedColon,