| 1 | ///! Serde error and result types |
| 2 | use craterust-analyzer cargo bendy 0.6.1 crate/::serderust-analyzer cargo bendy 0.6.1 serde/::commonrust-analyzer cargo bendy 0.6.1 serde/common/::*; |
| 3 | |
| 4 | pub type Resultrust-analyzer cargo bendy 0.6.1 serde/error/Result#<T, E = Errorrust-analyzer cargo bendy 0.6.1 serde/error/Error#> = stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/::Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<T, E>; |
| 5 | |
| 6 | /// An enumeration of potential errors that appear during serde serialiation and |
| 7 | /// deserialization |
| 8 | #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:)] |
| 9 | pub enum Errorrust-analyzer cargo bendy 0.6.1 serde/error/Error# { |
| 10 | /// Error that occurs if a map with a key type which does not serialize to |
| 11 | /// a byte string is encountered |
| 12 | ArbitraryMapKeysUnsupportedrust-analyzer cargo bendy 0.6.1 serde/error/Error#ArbitraryMapKeysUnsupported#, |
| 13 | /// Error that occurs if methods on MapSerializer are called out of order |
| 14 | MapSerializationCallOrderrust-analyzer cargo bendy 0.6.1 serde/error/Error#MapSerializationCallOrder#, |
| 15 | /// Error that occurs if a bool is deserialized from an integer value other |
| 16 | /// than `0` or `1` |
| 17 | InvalidBoolrust-analyzer cargo bendy 0.6.1 serde/error/Error#InvalidBool#(Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#), |
| 18 | /// Error that occurs if an f32 is deserialized from an string of length other |
| 19 | /// than 4 |
| 20 | InvalidF32rust-analyzer cargo bendy 0.6.1 serde/error/Error#InvalidF32#(usize), |
| 21 | /// Error that occurs if an f64 is deserialized from an string of length other |
| 22 | /// than 8 |
| 23 | InvalidF64rust-analyzer cargo bendy 0.6.1 serde/error/Error#InvalidF64#(usize), |
| 24 | /// Error that occurs if a char is deserialized from a string containing more |
| 25 | /// than one character |
| 26 | InvalidCharrust-analyzer cargo bendy 0.6.1 serde/error/Error#InvalidChar#(usize), |
| 27 | /// Error that occurs if trailing bytes remain after deserialization, if the |
| 28 | /// deserializer is configured to forbid trailing bytes |
| 29 | TrailingBytesrust-analyzer cargo bendy 0.6.1 serde/error/Error#TrailingBytes#, |
| 30 | /// Error that occurs if a serde-related error occurs during serialization |
| 31 | CustomEncoderust-analyzer cargo bendy 0.6.1 serde/error/Error#CustomEncode#(Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#), |
| 32 | /// Error that occurs if a serde-related error occurs during deserialization |
| 33 | CustomDecoderust-analyzer cargo bendy 0.6.1 serde/error/Error#CustomDecode#(Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#), |
| 34 | /// Error that occurs if a problem is encountered during serialization |
| 35 | Encoderust-analyzer cargo bendy 0.6.1 serde/error/Error#Encode#(encodingrust-analyzer cargo bendy 0.6.1 encoding/::Errorrust-analyzer cargo bendy 0.6.1 encoding/error/Error#), |
| 36 | /// Error that occurs if a problem is encountered during deserialization |
| 37 | Decoderust-analyzer cargo bendy 0.6.1 serde/error/Error#Decode#(decodingrust-analyzer cargo bendy 0.6.1 decoding/::Errorrust-analyzer cargo bendy 0.6.1 decoding/error/Error#), |
| 38 | } |
| 39 | |
| 40 | impl Fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/From#<encodingrust-analyzer cargo bendy 0.6.1 encoding/::Errorrust-analyzer cargo bendy 0.6.1 encoding/error/Error#> for Errorrust-analyzer cargo bendy 0.6.1 serde/error/Error# { |
| 41 | fn fromrust-analyzer cargo bendy 0.6.1 serde/error/impl#[Error][`From<encoding::Error>`]from().(encoding_error: encodingrust-analyzer cargo bendy 0.6.1 encoding/::Errorrust-analyzer cargo bendy 0.6.1 encoding/error/Error#) -> Selfrust-analyzer cargo bendy 0.6.1 serde/error/impl#[Error][`From<encoding::Error>`] { |
| 42 | Errorrust-analyzer cargo bendy 0.6.1 serde/error/Error#::Encoderust-analyzer cargo bendy 0.6.1 serde/error/Error#Encode#(encoding_error) |
| 43 | } |
| 44 | } |
| 45 | |
| 46 | impl Fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/From#<decodingrust-analyzer cargo bendy 0.6.1 decoding/::Errorrust-analyzer cargo bendy 0.6.1 decoding/error/Error#> for Errorrust-analyzer cargo bendy 0.6.1 serde/error/Error# { |
| 47 | fn fromrust-analyzer cargo bendy 0.6.1 serde/error/impl#[Error][`From<decoding::Error>`]from().(decoding_error: decodingrust-analyzer cargo bendy 0.6.1 decoding/::Errorrust-analyzer cargo bendy 0.6.1 decoding/error/Error#) -> Selfrust-analyzer cargo bendy 0.6.1 serde/error/impl#[Error][`From<decoding::Error>`] { |
| 48 | Errorrust-analyzer cargo bendy 0.6.1 serde/error/Error#::Decoderust-analyzer cargo bendy 0.6.1 serde/error/Error#Decode#(decoding_error) |
| 49 | } |
| 50 | } |
| 51 | |
| 52 | impl Fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/From#<ParseIntErrorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/error/ParseIntError#> for Errorrust-analyzer cargo bendy 0.6.1 serde/error/Error# { |
| 53 | fn fromrust-analyzer cargo bendy 0.6.1 serde/error/impl#[Error][`From<ParseIntError>`]from().(parse_int_error: ParseIntErrorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/error/ParseIntError#) -> Selfrust-analyzer cargo bendy 0.6.1 serde/error/impl#[Error][`From<ParseIntError>`] { |
| 54 | Errorrust-analyzer cargo bendy 0.6.1 serde/error/Error#::Decoderust-analyzer cargo bendy 0.6.1 serde/error/Error#Decode#(parse_int_error.intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().()) |
| 55 | } |
| 56 | } |
| 57 | |
| 58 | impl Fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/From#<Utf8Errorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/error/Utf8Error#> for Errorrust-analyzer cargo bendy 0.6.1 serde/error/Error# { |
| 59 | fn fromrust-analyzer cargo bendy 0.6.1 serde/error/impl#[Error][`From<Utf8Error>`]from().(utf8_error: Utf8Errorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/error/Utf8Error#) -> Selfrust-analyzer cargo bendy 0.6.1 serde/error/impl#[Error][`From<Utf8Error>`] { |
| 60 | Errorrust-analyzer cargo bendy 0.6.1 serde/error/Error#::Decoderust-analyzer cargo bendy 0.6.1 serde/error/Error#Decode#(utf8_error.intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().()) |
| 61 | } |
| 62 | } |
| 63 | |
| 64 | impl serderust-analyzer cargo serde 1.0.140 crate/::serrust-analyzer cargo serde 1.0.140 ser/::Errorrust-analyzer cargo serde 1.0.140 ser/Error# for Errorrust-analyzer cargo bendy 0.6.1 serde/error/Error# { |
| 65 | fn customrust-analyzer cargo bendy 0.6.1 serde/error/impl#[Error][Error]custom().<T>(msg: T) -> Selfrust-analyzer cargo bendy 0.6.1 serde/error/impl#[Error][Error] |
| 66 | where |
| 67 | T: Displayrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Display#, |
| 68 | { |
| 69 | Errorrust-analyzer cargo bendy 0.6.1 serde/error/Error#::CustomEncoderust-analyzer cargo bendy 0.6.1 serde/error/Error#CustomEncode#(msg.to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().()) |
| 70 | } |
| 71 | } |
| 72 | |
| 73 | impl serderust-analyzer cargo serde 1.0.140 crate/::derust-analyzer cargo serde 1.0.140 de/::Errorrust-analyzer cargo serde 1.0.140 de/Error# for Errorrust-analyzer cargo bendy 0.6.1 serde/error/Error# { |
| 74 | fn customrust-analyzer cargo bendy 0.6.1 serde/error/impl#[Error][Error]custom().<T: Displayrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Display#>(msg: T) -> Selfrust-analyzer cargo bendy 0.6.1 serde/error/impl#[Error][Error] { |
| 75 | Errorrust-analyzer cargo bendy 0.6.1 serde/error/Error#::CustomDecoderust-analyzer cargo bendy 0.6.1 serde/error/Error#CustomDecode#(msg.to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().()) |
| 76 | } |
| 77 | } |
| 78 | |
| 79 | impl Displayrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Display# for Errorrust-analyzer cargo bendy 0.6.1 serde/error/Error# { |
| 80 | fn fmtrust-analyzer cargo bendy 0.6.1 serde/error/impl#[Error][Display]fmt().(&self, f: &mut Formatterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Formatter#) -> fmtrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc fmt/::Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Result# { |
| 81 | match self { |
| 82 | Errorrust-analyzer cargo bendy 0.6.1 serde/error/Error#::CustomEncoderust-analyzer cargo bendy 0.6.1 serde/error/Error#CustomEncode#(message) => writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "Serialization failed: {}", message), |
| 83 | Errorrust-analyzer cargo bendy 0.6.1 serde/error/Error#::CustomDecoderust-analyzer cargo bendy 0.6.1 serde/error/Error#CustomDecode#(message) => writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "Deserialization failed: {}", message), |
| 84 | Errorrust-analyzer cargo bendy 0.6.1 serde/error/Error#::Encoderust-analyzer cargo bendy 0.6.1 serde/error/Error#Encode#(error) => writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "{}", error), |
| 85 | Errorrust-analyzer cargo bendy 0.6.1 serde/error/Error#::Decoderust-analyzer cargo bendy 0.6.1 serde/error/Error#Decode#(error) => writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "{}", error), |
| 86 | Errorrust-analyzer cargo bendy 0.6.1 serde/error/Error#::InvalidBoolrust-analyzer cargo bendy 0.6.1 serde/error/Error#InvalidBool#(value) => writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "Invalid integer value for bool: `{}`", value), |
| 87 | Errorrust-analyzer cargo bendy 0.6.1 serde/error/Error#::InvalidF32rust-analyzer cargo bendy 0.6.1 serde/error/Error#InvalidF32#(length) => { |
| 88 | writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "Invalid length byte string value for f32: {}", length) |
| 89 | }, |
| 90 | Errorrust-analyzer cargo bendy 0.6.1 serde/error/Error#::InvalidF64rust-analyzer cargo bendy 0.6.1 serde/error/Error#InvalidF64#(length) => { |
| 91 | writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "Invalid length byte string value for f64: {}", length) |
| 92 | }, |
| 93 | Errorrust-analyzer cargo bendy 0.6.1 serde/error/Error#::InvalidCharrust-analyzer cargo bendy 0.6.1 serde/error/Error#InvalidChar#(length) => { |
| 94 | writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "Invalid length string value for char: {}", length) |
| 95 | }, |
| 96 | Errorrust-analyzer cargo bendy 0.6.1 serde/error/Error#::TrailingBytesrust-analyzer cargo bendy 0.6.1 serde/error/Error#TrailingBytes# => writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "Trailing bytes remain after deserializing value"), |
| 97 | Errorrust-analyzer cargo bendy 0.6.1 serde/error/Error#::ArbitraryMapKeysUnsupportedrust-analyzer cargo bendy 0.6.1 serde/error/Error#ArbitraryMapKeysUnsupported# => writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!( |
| 98 | f, |
| 99 | "Maps with key types that do not serialize to byte strings are unsupported", |
| 100 | ), |
| 101 | Errorrust-analyzer cargo bendy 0.6.1 serde/error/Error#::MapSerializationCallOrderrust-analyzer cargo bendy 0.6.1 serde/error/Error#MapSerializationCallOrder# => { |
| 102 | writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "Map serialization methods called out of order") |
| 103 | }, |
| 104 | } |
| 105 | } |
| 106 | } |
| 107 | |
| 108 | impl stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::errorrust-analyzer cargo std https://github.com/rust-lang/rust/library/std error/::Errorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core error/Error# for Errorrust-analyzer cargo bendy 0.6.1 serde/error/Error# {} |