| 1 | //! Deserialization. |
| 2 | |
| 3 | use corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::f32rust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/; |
| 4 | use corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::markerrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/::PhantomDatarust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/PhantomData#; |
| 5 | use corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/; |
| 6 | use corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::strrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/; |
| 7 | use halfrust-analyzer cargo half 2.6.0 crate/::f16rust-analyzer cargo half 2.6.0 binary16/f16#; |
| 8 | use serderust-analyzer cargo serde 1.0.144 crate/::derust-analyzer cargo serde 1.0.144 de/; |
| 9 | #[cfg(feature = "std")] |
| 10 | use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/; |
| 11 | |
| 12 | use craterust-analyzer cargo serde_cbor_2 0.13.0 crate/::errorrust-analyzer cargo serde_cbor_2 0.13.0 error/::{Errorrust-analyzer cargo serde_cbor_2 0.13.0 error/Error#, ErrorCoderust-analyzer cargo serde_cbor_2 0.13.0 error/ErrorCode#, Resultrust-analyzer cargo serde_cbor_2 0.13.0 error/Result#}; |
| 13 | #[cfg(not(feature = "unsealed_read_write"))] |
| 14 | use craterust-analyzer cargo serde_cbor_2 0.13.0 crate/::readrust-analyzer cargo serde_cbor_2 0.13.0 read/::EitherLifetimerust-analyzer cargo serde_cbor_2 0.13.0 read/EitherLifetime#; |
| 15 | #[cfg(feature = "unsealed_read_write")] |
| 16 | pub use craterust-analyzer cargo serde_cbor_2 0.13.0 crate/::readrust-analyzer cargo serde_cbor_2 0.13.0 read/::EitherLifetimerust-analyzer cargo serde_cbor_2 0.13.0 read/EitherLifetime#; |
| 17 | #[cfg(feature = "std")] |
| 18 | pub use craterust-analyzer cargo serde_cbor_2 0.13.0 crate/::readrust-analyzer cargo serde_cbor_2 0.13.0 read/::IoReadrust-analyzer cargo serde_cbor_2 0.13.0 read/IoRead#; |
| 19 | use craterust-analyzer cargo serde_cbor_2 0.13.0 crate/::readrust-analyzer cargo serde_cbor_2 0.13.0 read/::Offsetrust-analyzer cargo serde_cbor_2 0.13.0 read/Offset#; |
| 20 | #[cfg(any(feature = "std", feature = "alloc"))] |
| 21 | pub use craterust-analyzer cargo serde_cbor_2 0.13.0 crate/::readrust-analyzer cargo serde_cbor_2 0.13.0 read/::SliceReadrust-analyzer cargo serde_cbor_2 0.13.0 read/SliceRead#; |
| 22 | pub use craterust-analyzer cargo serde_cbor_2 0.13.0 crate/::readrust-analyzer cargo serde_cbor_2 0.13.0 read/::{MutSliceReadrust-analyzer cargo serde_cbor_2 0.13.0 read/MutSliceRead#, Readrust-analyzer cargo serde_cbor_2 0.13.0 read/Read#, SliceReadFixedrust-analyzer cargo serde_cbor_2 0.13.0 read/SliceReadFixed#}; |
| 23 | #[cfg(feature = "tags")] |
| 24 | use craterust-analyzer cargo serde_cbor_2 0.13.0 crate/::tagsrust-analyzer cargo serde_cbor_2 0.13.0 tags/::set_tagrust-analyzer cargo serde_cbor_2 0.13.0 tags/set_tag().; |
| 25 | /// Decodes a value from CBOR data in a slice. |
| 26 | /// |
| 27 | /// # Examples |
| 28 | /// |
| 29 | /// Deserialize a `String` |
| 30 | /// |
| 31 | /// ``` |
| 32 | /// # use serde_cbor_2::de; |
| 33 | /// let v: Vec<u8> = vec![0x66, 0x66, 0x6f, 0x6f, 0x62, 0x61, 0x72]; |
| 34 | /// let value: String = de::from_slice(&v[..]).unwrap(); |
| 35 | /// assert_eq!(value, "foobar"); |
| 36 | /// ``` |
| 37 | /// |
| 38 | /// Deserialize a borrowed string with zero copies. |
| 39 | /// |
| 40 | /// ``` |
| 41 | /// # use serde_cbor_2::de; |
| 42 | /// let v: Vec<u8> = vec![0x66, 0x66, 0x6f, 0x6f, 0x62, 0x61, 0x72]; |
| 43 | /// let value: &str = de::from_slice(&v[..]).unwrap(); |
| 44 | /// assert_eq!(value, "foobar"); |
| 45 | /// ``` |
| 46 | #[cfg(any(feature = "std", feature = "alloc"))] |
| 47 | pub fn from_slicerust-analyzer cargo serde_cbor_2 0.13.0 de/from_slice().<'a, T>(slice: &'a [u8]) -> Resultrust-analyzer cargo serde_cbor_2 0.13.0 error/Result#<T> |
| 48 | where |
| 49 | T: derust-analyzer cargo serde 1.0.144 de/::Deserializerust-analyzer cargo serde 1.0.144 de/Deserialize#<'a>, |
| 50 | { |
| 51 | let mut deserializer = Deserializerrust-analyzer cargo serde_cbor_2 0.13.0 de/Deserializer#::from_slicerust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<SliceRead<'a>>`]from_slice().(slice); |
| 52 | let value = derust-analyzer cargo serde 1.0.144 de/::Deserializerust-analyzer cargo serde 1.0.144 de/Deserialize#::deserializerust-analyzer cargo serde 1.0.144 de/Deserialize#deserialize().(&mut deserializer)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 53 | deserializer.endrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]end().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 54 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(value) |
| 55 | } |
| 56 | |
| 57 | // When the "std" feature is enabled there should be little to no need to ever use this function, |
| 58 | // as `from_slice` covers all use cases (at the expense of being less efficient). |
| 59 | /// Decode a value from CBOR data in a mutable slice. |
| 60 | /// |
| 61 | /// This can be used in analogy to `from_slice`. Unlike `from_slice`, this will use the slice's |
| 62 | /// mutability to rearrange data in it in order to resolve indefinite byte or text strings without |
| 63 | /// resorting to allocations. |
| 64 | pub fn from_mut_slicerust-analyzer cargo serde_cbor_2 0.13.0 de/from_mut_slice().<'a, T>(slice: &'a mut [u8]) -> Resultrust-analyzer cargo serde_cbor_2 0.13.0 error/Result#<T> |
| 65 | where |
| 66 | T: derust-analyzer cargo serde 1.0.144 de/::Deserializerust-analyzer cargo serde 1.0.144 de/Deserialize#<'a>, |
| 67 | { |
| 68 | let mut deserializer = Deserializerrust-analyzer cargo serde_cbor_2 0.13.0 de/Deserializer#::from_mut_slicerust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<MutSliceRead<'a>>`]from_mut_slice().(slice); |
| 69 | let value = derust-analyzer cargo serde 1.0.144 de/::Deserializerust-analyzer cargo serde 1.0.144 de/Deserialize#::deserializerust-analyzer cargo serde 1.0.144 de/Deserialize#deserialize().(&mut deserializer)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 70 | deserializer.endrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]end().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 71 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(value) |
| 72 | } |
| 73 | |
| 74 | // When the "std" feature is enabled there should be little to no need to ever use this function, |
| 75 | // as `from_slice` covers all use cases and is much more reliable (at the expense of being less |
| 76 | // efficient). |
| 77 | /// Decode a value from CBOR data using a scratch buffer. |
| 78 | /// |
| 79 | /// Users should generally prefer to use `from_slice` or `from_mut_slice` over this function, |
| 80 | /// as decoding may fail when the scratch buffer turns out to be too small. |
| 81 | /// |
| 82 | /// A realistic use case for this method would be decoding in a `no_std` environment from an |
| 83 | /// immutable slice that is too large to copy. |
| 84 | pub fn from_slice_with_scratchrust-analyzer cargo serde_cbor_2 0.13.0 de/from_slice_with_scratch().<'a, 'b, T>(slice: &'a [u8], scratch: &'b mut [u8]) -> Resultrust-analyzer cargo serde_cbor_2 0.13.0 error/Result#<T> |
| 85 | where |
| 86 | T: derust-analyzer cargo serde 1.0.144 de/::Deserializerust-analyzer cargo serde 1.0.144 de/Deserialize#<'a>, |
| 87 | { |
| 88 | let mut deserializer = Deserializerrust-analyzer cargo serde_cbor_2 0.13.0 de/Deserializer#::from_slice_with_scratchrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<SliceReadFixed<'a, 'b>>`]from_slice_with_scratch().(slice, scratch); |
| 89 | let value = derust-analyzer cargo serde 1.0.144 de/::Deserializerust-analyzer cargo serde 1.0.144 de/Deserialize#::deserializerust-analyzer cargo serde 1.0.144 de/Deserialize#deserialize().(&mut deserializer)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 90 | deserializer.endrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]end().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 91 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(value) |
| 92 | } |
| 93 | |
| 94 | /// Decodes a value from CBOR data in a reader. |
| 95 | /// |
| 96 | /// # Examples |
| 97 | /// |
| 98 | /// Deserialize a `String` |
| 99 | /// |
| 100 | /// ``` |
| 101 | /// # use serde_cbor_2::de; |
| 102 | /// let v: Vec<u8> = vec![0x66, 0x66, 0x6f, 0x6f, 0x62, 0x61, 0x72]; |
| 103 | /// let value: String = de::from_reader(&v[..]).unwrap(); |
| 104 | /// assert_eq!(value, "foobar"); |
| 105 | /// ``` |
| 106 | /// |
| 107 | /// Note that `from_reader` cannot borrow data: |
| 108 | /// |
| 109 | /// ```compile_fail |
| 110 | /// # use serde_cbor_2::de; |
| 111 | /// let v: Vec<u8> = vec![0x66, 0x66, 0x6f, 0x6f, 0x62, 0x61, 0x72]; |
| 112 | /// let value: &str = de::from_reader(&v[..]).unwrap(); |
| 113 | /// assert_eq!(value, "foobar"); |
| 114 | /// ``` |
| 115 | #[cfg(feature = "std")] |
| 116 | pub fn from_readerrust-analyzer cargo serde_cbor_2 0.13.0 de/from_reader().<T, R>(reader: R) -> Resultrust-analyzer cargo serde_cbor_2 0.13.0 error/Result#<T> |
| 117 | where |
| 118 | T: derust-analyzer cargo serde 1.0.144 de/::DeserializeOwnedrust-analyzer cargo serde 1.0.144 de/DeserializeOwned#, |
| 119 | R: iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::Readrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/Read#, |
| 120 | { |
| 121 | let mut deserializer = Deserializerrust-analyzer cargo serde_cbor_2 0.13.0 de/Deserializer#::from_readerrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<IoRead<R>>`]from_reader().(reader); |
| 122 | let value = derust-analyzer cargo serde 1.0.144 de/::Deserializerust-analyzer cargo serde 1.0.144 de/Deserialize#::deserializerust-analyzer cargo serde 1.0.144 de/Deserialize#deserialize().(&mut deserializer)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 123 | deserializer.endrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]end().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 124 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(value) |
| 125 | } |
| 126 | |
| 127 | /// A Serde `Deserialize`r of CBOR data. |
| 128 | #[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:)] |
| 129 | pub struct Deserializerrust-analyzer cargo serde_cbor_2 0.13.0 de/Deserializer#<R> { |
| 130 | readrust-analyzer cargo serde_cbor_2 0.13.0 de/Deserializer#read.: R, |
| 131 | remaining_depthrust-analyzer cargo serde_cbor_2 0.13.0 de/Deserializer#remaining_depth.: u8, |
| 132 | accept_namedrust-analyzer cargo serde_cbor_2 0.13.0 de/Deserializer#accept_named.: bool, |
| 133 | accept_packedrust-analyzer cargo serde_cbor_2 0.13.0 de/Deserializer#accept_packed.: bool, |
| 134 | accept_standard_enumsrust-analyzer cargo serde_cbor_2 0.13.0 de/Deserializer#accept_standard_enums.: bool, |
| 135 | accept_legacy_enumsrust-analyzer cargo serde_cbor_2 0.13.0 de/Deserializer#accept_legacy_enums.: bool, |
| 136 | } |
| 137 | |
| 138 | #[cfg(feature = "std")] |
| 139 | impl<R> Deserializerrust-analyzer cargo serde_cbor_2 0.13.0 de/Deserializer#<IoReadrust-analyzer cargo serde_cbor_2 0.13.0 read/IoRead#<R>> |
| 140 | where |
| 141 | R: iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::Readrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/Read#, |
| 142 | { |
| 143 | /// Constructs a `Deserializer` which reads from a `Read`er. |
| 144 | pub fn from_readerrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<IoRead<R>>`]from_reader().(reader: R) -> Deserializerrust-analyzer cargo serde_cbor_2 0.13.0 de/Deserializer#<IoReadrust-analyzer cargo serde_cbor_2 0.13.0 read/IoRead#<R>> { |
| 145 | Deserializerrust-analyzer cargo serde_cbor_2 0.13.0 de/Deserializer#::newrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]new().(IoReadrust-analyzer cargo serde_cbor_2 0.13.0 read/IoRead#::newrust-analyzer cargo serde_cbor_2 0.13.0 read/impl#[`IoRead<R>`]new().(reader)) |
| 146 | } |
| 147 | } |
| 148 | |
| 149 | #[cfg(any(feature = "std", feature = "alloc"))] |
| 150 | impl<'a> Deserializerrust-analyzer cargo serde_cbor_2 0.13.0 de/Deserializer#<SliceReadrust-analyzer cargo serde_cbor_2 0.13.0 read/SliceRead#<'a>> { |
| 151 | /// Constructs a `Deserializer` which reads from a slice. |
| 152 | /// |
| 153 | /// Borrowed strings and byte slices will be provided when possible. |
| 154 | pub fn from_slicerust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<SliceRead<'a>>`]from_slice().(bytes: &'a [u8]) -> Deserializerrust-analyzer cargo serde_cbor_2 0.13.0 de/Deserializer#<SliceReadrust-analyzer cargo serde_cbor_2 0.13.0 read/SliceRead#<'a>> { |
| 155 | Deserializerrust-analyzer cargo serde_cbor_2 0.13.0 de/Deserializer#::newrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]new().(SliceReadrust-analyzer cargo serde_cbor_2 0.13.0 read/SliceRead#::newrust-analyzer cargo serde_cbor_2 0.13.0 read/impl#[`SliceRead<'a>`]new().(bytes)) |
| 156 | } |
| 157 | } |
| 158 | |
| 159 | impl<'a> Deserializerrust-analyzer cargo serde_cbor_2 0.13.0 de/Deserializer#<MutSliceReadrust-analyzer cargo serde_cbor_2 0.13.0 read/MutSliceRead#<'a>> { |
| 160 | /// Constructs a `Deserializer` which reads from a mutable slice that doubles as its own |
| 161 | /// scratch buffer. |
| 162 | /// |
| 163 | /// Borrowed strings and byte slices will be provided even for indefinite strings. |
| 164 | pub fn from_mut_slicerust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<MutSliceRead<'a>>`]from_mut_slice().(bytes: &'a mut [u8]) -> Deserializerrust-analyzer cargo serde_cbor_2 0.13.0 de/Deserializer#<MutSliceReadrust-analyzer cargo serde_cbor_2 0.13.0 read/MutSliceRead#<'a>> { |
| 165 | Deserializerrust-analyzer cargo serde_cbor_2 0.13.0 de/Deserializer#::newrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]new().(MutSliceReadrust-analyzer cargo serde_cbor_2 0.13.0 read/MutSliceRead#::newrust-analyzer cargo serde_cbor_2 0.13.0 read/impl#[`MutSliceRead<'a>`]new().(bytes)) |
| 166 | } |
| 167 | } |
| 168 | |
| 169 | impl<'a, 'b> Deserializerrust-analyzer cargo serde_cbor_2 0.13.0 de/Deserializer#<SliceReadFixedrust-analyzer cargo serde_cbor_2 0.13.0 read/SliceReadFixed#<'a, 'b>> { |
| 170 | #[doc(hidden)] |
| 171 | pub fn from_slice_with_scratchrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<SliceReadFixed<'a, 'b>>`]from_slice_with_scratch().( |
| 172 | bytes: &'a [u8], |
| 173 | scratch: &'b mut [u8], |
| 174 | ) -> Deserializerrust-analyzer cargo serde_cbor_2 0.13.0 de/Deserializer#<SliceReadFixedrust-analyzer cargo serde_cbor_2 0.13.0 read/SliceReadFixed#<'a, 'b>> { |
| 175 | Deserializerrust-analyzer cargo serde_cbor_2 0.13.0 de/Deserializer#::newrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]new().(SliceReadFixedrust-analyzer cargo serde_cbor_2 0.13.0 read/SliceReadFixed#::newrust-analyzer cargo serde_cbor_2 0.13.0 read/impl#[`SliceReadFixed<'a, 'b>`]new().(bytes, scratch)) |
| 176 | } |
| 177 | } |
| 178 | |
| 179 | impl<'de, R> Deserializerrust-analyzer cargo serde_cbor_2 0.13.0 de/Deserializer#<R> |
| 180 | where |
| 181 | R: Readrust-analyzer cargo serde_cbor_2 0.13.0 read/Read#<'de>, |
| 182 | { |
| 183 | /// Constructs a `Deserializer` from one of the possible serde_cbor_2 input sources. |
| 184 | /// |
| 185 | /// `from_slice` and `from_reader` should normally be used instead of this method. |
| 186 | pub fn newrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]new().(read: R) -> Selfrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`] { |
| 187 | Deserializerrust-analyzer cargo serde_cbor_2 0.13.0 de/Deserializer# { |
| 188 | readrust-analyzer cargo serde_cbor_2 0.13.0 de/Deserializer#read., |
| 189 | remaining_depthrust-analyzer cargo serde_cbor_2 0.13.0 de/Deserializer#remaining_depth.: 128, |
| 190 | accept_namedrust-analyzer cargo serde_cbor_2 0.13.0 de/Deserializer#accept_named.: true, |
| 191 | accept_packedrust-analyzer cargo serde_cbor_2 0.13.0 de/Deserializer#accept_packed.: true, |
| 192 | accept_standard_enumsrust-analyzer cargo serde_cbor_2 0.13.0 de/Deserializer#accept_standard_enums.: true, |
| 193 | accept_legacy_enumsrust-analyzer cargo serde_cbor_2 0.13.0 de/Deserializer#accept_legacy_enums.: true, |
| 194 | } |
| 195 | } |
| 196 | |
| 197 | /// Don't accept named variants and fields. |
| 198 | pub fn disable_named_formatrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]disable_named_format().(mut self) -> Selfrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`] { |
| 199 | self.accept_namedrust-analyzer cargo serde_cbor_2 0.13.0 de/Deserializer#accept_named. = false; |
| 200 | self |
| 201 | } |
| 202 | |
| 203 | /// Don't accept numbered variants and fields. |
| 204 | pub fn disable_packed_formatrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]disable_packed_format().(mut self) -> Selfrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`] { |
| 205 | self.accept_packedrust-analyzer cargo serde_cbor_2 0.13.0 de/Deserializer#accept_packed. = false; |
| 206 | self |
| 207 | } |
| 208 | |
| 209 | /// Don't accept the new enum format used by `serde_cbor_2` versions >= v0.10. |
| 210 | pub fn disable_standard_enumsrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]disable_standard_enums().(mut self) -> Selfrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`] { |
| 211 | self.accept_standard_enumsrust-analyzer cargo serde_cbor_2 0.13.0 de/Deserializer#accept_standard_enums. = false; |
| 212 | self |
| 213 | } |
| 214 | |
| 215 | /// Don't accept the old enum format used by `serde_cbor_2` versions <= v0.9. |
| 216 | pub fn disable_legacy_enumsrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]disable_legacy_enums().(mut self) -> Selfrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`] { |
| 217 | self.accept_legacy_enumsrust-analyzer cargo serde_cbor_2 0.13.0 de/Deserializer#accept_legacy_enums. = false; |
| 218 | self |
| 219 | } |
| 220 | |
| 221 | /// This method should be called after a value has been deserialized to ensure there is no |
| 222 | /// trailing data in the input source. |
| 223 | pub fn endrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]end().(&mut self) -> Resultrust-analyzer cargo serde_cbor_2 0.13.0 error/Result#<()> { |
| 224 | match self.nextrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]next().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch(). { |
| 225 | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(_) => Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(self.errorrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]error().(ErrorCoderust-analyzer cargo serde_cbor_2 0.13.0 error/ErrorCode#::TrailingDatarust-analyzer cargo serde_cbor_2 0.13.0 error/ErrorCode#TrailingData#)), |
| 226 | Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None# => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(()), |
| 227 | } |
| 228 | } |
| 229 | |
| 230 | /// Turn a CBOR deserializer into an iterator over values of type T. |
| 231 | #[allow(clippy::should_implement_trait)] // Trait doesn't allow unconstrained T. |
| 232 | pub fn into_iterrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]into_iter().<T>(self) -> StreamDeserializerrust-analyzer cargo serde_cbor_2 0.13.0 de/StreamDeserializer#<'de, R, T> |
| 233 | where |
| 234 | T: derust-analyzer cargo serde 1.0.144 de/::Deserializerust-analyzer cargo serde 1.0.144 de/Deserialize#<'de>, |
| 235 | { |
| 236 | StreamDeserializerrust-analyzer cargo serde_cbor_2 0.13.0 de/StreamDeserializer# { |
| 237 | derust-analyzer cargo serde_cbor_2 0.13.0 de/StreamDeserializer#de.: self, |
| 238 | outputrust-analyzer cargo serde_cbor_2 0.13.0 de/StreamDeserializer#output.: PhantomDatarust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/PhantomData#, |
| 239 | lifetimerust-analyzer cargo serde_cbor_2 0.13.0 de/StreamDeserializer#lifetime.: PhantomDatarust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/PhantomData#, |
| 240 | } |
| 241 | } |
| 242 | |
| 243 | fn nextrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]next().(&mut self) -> Resultrust-analyzer cargo serde_cbor_2 0.13.0 error/Result#<Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<u8>> { |
| 244 | self.readrust-analyzer cargo serde_cbor_2 0.13.0 de/Deserializer#read..nextrust-analyzer cargo serde_cbor_2 0.13.0 read/Read#next().() |
| 245 | } |
| 246 | |
| 247 | fn peekrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]peek().(&mut self) -> Resultrust-analyzer cargo serde_cbor_2 0.13.0 error/Result#<Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<u8>> { |
| 248 | self.readrust-analyzer cargo serde_cbor_2 0.13.0 de/Deserializer#read..peekrust-analyzer cargo serde_cbor_2 0.13.0 read/Read#peek().() |
| 249 | } |
| 250 | |
| 251 | fn consumerust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]consume().(&mut self) { |
| 252 | self.readrust-analyzer cargo serde_cbor_2 0.13.0 de/Deserializer#read..discardrust-analyzer cargo serde_cbor_2 0.13.0 read/Read#discard().(); |
| 253 | } |
| 254 | |
| 255 | fn errorrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]error().(&self, reason: ErrorCoderust-analyzer cargo serde_cbor_2 0.13.0 error/ErrorCode#) -> Errorrust-analyzer cargo serde_cbor_2 0.13.0 error/Error# { |
| 256 | let offset = self.readrust-analyzer cargo serde_cbor_2 0.13.0 de/Deserializer#read..offsetrust-analyzer cargo serde_cbor_2 0.13.0 read/Read#offset().(); |
| 257 | Errorrust-analyzer cargo serde_cbor_2 0.13.0 error/Error#::syntaxrust-analyzer cargo serde_cbor_2 0.13.0 error/impl#[Error]syntax().(reason, offset) |
| 258 | } |
| 259 | |
| 260 | fn parse_u8rust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]parse_u8().(&mut self) -> Resultrust-analyzer cargo serde_cbor_2 0.13.0 error/Result#<u8> { |
| 261 | match self.nextrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]next().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch(). { |
| 262 | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(byte) => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(byte), |
| 263 | Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None# => Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(self.errorrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]error().(ErrorCoderust-analyzer cargo serde_cbor_2 0.13.0 error/ErrorCode#::EofWhileParsingValuerust-analyzer cargo serde_cbor_2 0.13.0 error/ErrorCode#EofWhileParsingValue#)), |
| 264 | } |
| 265 | } |
| 266 | |
| 267 | fn parse_u16rust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]parse_u16().(&mut self) -> Resultrust-analyzer cargo serde_cbor_2 0.13.0 error/Result#<u16> { |
| 268 | let mut buf = [0; 2]; |
| 269 | self.readrust-analyzer cargo serde_cbor_2 0.13.0 de/Deserializer#read. |
| 270 | .read_intorust-analyzer cargo serde_cbor_2 0.13.0 read/Read#read_into().(&mut buf) |
| 271 | .maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]map().(|()| u16::from_be_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[u16]from_be_bytes().(buf)) |
| 272 | } |
| 273 | |
| 274 | fn parse_u32rust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]parse_u32().(&mut self) -> Resultrust-analyzer cargo serde_cbor_2 0.13.0 error/Result#<u32> { |
| 275 | let mut buf = [0; 4]; |
| 276 | self.readrust-analyzer cargo serde_cbor_2 0.13.0 de/Deserializer#read. |
| 277 | .read_intorust-analyzer cargo serde_cbor_2 0.13.0 read/Read#read_into().(&mut buf) |
| 278 | .maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]map().(|()| u32::from_be_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[u32]from_be_bytes().(buf)) |
| 279 | } |
| 280 | |
| 281 | fn parse_u64rust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]parse_u64().(&mut self) -> Resultrust-analyzer cargo serde_cbor_2 0.13.0 error/Result#<u64> { |
| 282 | let mut buf = [0; 8]; |
| 283 | self.readrust-analyzer cargo serde_cbor_2 0.13.0 de/Deserializer#read. |
| 284 | .read_intorust-analyzer cargo serde_cbor_2 0.13.0 read/Read#read_into().(&mut buf) |
| 285 | .maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]map().(|()| u64::from_be_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[u64]from_be_bytes().(buf)) |
| 286 | } |
| 287 | |
| 288 | fn parse_bytesrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]parse_bytes().<V>(&mut self, len: usize, visitor: V) -> Resultrust-analyzer cargo serde_cbor_2 0.13.0 error/Result#<V::Valuerust-analyzer cargo serde 1.0.144 de/Visitor#Value#> |
| 289 | where |
| 290 | V: derust-analyzer cargo serde 1.0.144 de/::Visitorrust-analyzer cargo serde 1.0.144 de/Visitor#<'de>, |
| 291 | { |
| 292 | match self.readrust-analyzer cargo serde_cbor_2 0.13.0 de/Deserializer#read..readrust-analyzer cargo serde_cbor_2 0.13.0 read/Read#read().(len)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch(). { |
| 293 | EitherLifetimerust-analyzer cargo serde_cbor_2 0.13.0 read/EitherLifetime#::Longrust-analyzer cargo serde_cbor_2 0.13.0 read/EitherLifetime#Long#(buf) => visitor.visit_borrowed_bytesrust-analyzer cargo serde 1.0.144 de/Visitor#visit_borrowed_bytes().(buf), |
| 294 | EitherLifetimerust-analyzer cargo serde_cbor_2 0.13.0 read/EitherLifetime#::Shortrust-analyzer cargo serde_cbor_2 0.13.0 read/EitherLifetime#Short#(buf) => visitor.visit_bytesrust-analyzer cargo serde 1.0.144 de/Visitor#visit_bytes().(buf), |
| 295 | } |
| 296 | } |
| 297 | |
| 298 | fn parse_indefinite_bytesrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]parse_indefinite_bytes().<V>(&mut self, visitor: V) -> Resultrust-analyzer cargo serde_cbor_2 0.13.0 error/Result#<V::Valuerust-analyzer cargo serde 1.0.144 de/Visitor#Value#> |
| 299 | where |
| 300 | V: derust-analyzer cargo serde 1.0.144 de/::Visitorrust-analyzer cargo serde 1.0.144 de/Visitor#<'de>, |
| 301 | { |
| 302 | self.readrust-analyzer cargo serde_cbor_2 0.13.0 de/Deserializer#read..clear_bufferrust-analyzer cargo serde_cbor_2 0.13.0 read/Read#clear_buffer().(); |
| 303 | loop { |
| 304 | let byte = self.parse_u8rust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]parse_u8().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 305 | let len = match byte { |
| 306 | 0x40..=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeInclusive#0x57 => byte as usize rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().0x40, |
| 307 | 0x58 => self.parse_u8rust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]parse_u8().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch(). as usize, |
| 308 | 0x59 => self.parse_u16rust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]parse_u16().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch(). as usize, |
| 309 | 0x5a => self.parse_u32rust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]parse_u32().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch(). as usize, |
| 310 | 0x5b => { |
| 311 | let len = self.parse_u64rust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]parse_u64().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 312 | if len rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u64][`PartialOrd<Self>`]gt().>rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u64][`PartialOrd<Self>`]gt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u64][`PartialOrd<Self>`]gt().usize::MAXrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[usize]MAX. as u64 { |
| 313 | return Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(self.errorrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]error().(ErrorCoderust-analyzer cargo serde_cbor_2 0.13.0 error/ErrorCode#::LengthOutOfRangerust-analyzer cargo serde_cbor_2 0.13.0 error/ErrorCode#LengthOutOfRange#)); |
| 314 | } |
| 315 | len as usize |
| 316 | } |
| 317 | 0xff => break, |
| 318 | _ => return Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(self.errorrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]error().(ErrorCoderust-analyzer cargo serde_cbor_2 0.13.0 error/ErrorCode#::UnexpectedCoderust-analyzer cargo serde_cbor_2 0.13.0 error/ErrorCode#UnexpectedCode#)), |
| 319 | }; |
| 320 | |
| 321 | self.readrust-analyzer cargo serde_cbor_2 0.13.0 de/Deserializer#read..read_to_bufferrust-analyzer cargo serde_cbor_2 0.13.0 read/Read#read_to_buffer().(len)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 322 | } |
| 323 | |
| 324 | match self.readrust-analyzer cargo serde_cbor_2 0.13.0 de/Deserializer#read..take_bufferrust-analyzer cargo serde_cbor_2 0.13.0 read/Read#take_buffer().() { |
| 325 | EitherLifetimerust-analyzer cargo serde_cbor_2 0.13.0 read/EitherLifetime#::Longrust-analyzer cargo serde_cbor_2 0.13.0 read/EitherLifetime#Long#(buf) => visitor.visit_borrowed_bytesrust-analyzer cargo serde 1.0.144 de/Visitor#visit_borrowed_bytes().(buf), |
| 326 | EitherLifetimerust-analyzer cargo serde_cbor_2 0.13.0 read/EitherLifetime#::Shortrust-analyzer cargo serde_cbor_2 0.13.0 read/EitherLifetime#Short#(buf) => visitor.visit_bytesrust-analyzer cargo serde 1.0.144 de/Visitor#visit_bytes().(buf), |
| 327 | } |
| 328 | } |
| 329 | |
| 330 | fn convert_strrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]convert_str().(buf: &[u8], buf_end_offset: u64) -> Resultrust-analyzer cargo serde_cbor_2 0.13.0 error/Result#<&str> { |
| 331 | match strrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/::from_utf8rust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/converts/from_utf8().(buf) { |
| 332 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(s) => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(s), |
| 333 | Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(e) => { |
| 334 | let shift = buf.lenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]len().() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().e.valid_up_torust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/error/impl#[Utf8Error]valid_up_to().(); |
| 335 | let offset = buf_end_offset rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`Sub<Self>`]sub().shift as u64; |
| 336 | Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(Errorrust-analyzer cargo serde_cbor_2 0.13.0 error/Error#::syntaxrust-analyzer cargo serde_cbor_2 0.13.0 error/impl#[Error]syntax().(ErrorCoderust-analyzer cargo serde_cbor_2 0.13.0 error/ErrorCode#::InvalidUtf8rust-analyzer cargo serde_cbor_2 0.13.0 error/ErrorCode#InvalidUtf8#, offset)) |
| 337 | } |
| 338 | } |
| 339 | } |
| 340 | |
| 341 | fn parse_strrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]parse_str().<V>(&mut self, len: usize, visitor: V) -> Resultrust-analyzer cargo serde_cbor_2 0.13.0 error/Result#<V::Valuerust-analyzer cargo serde 1.0.144 de/Visitor#Value#> |
| 342 | where |
| 343 | V: derust-analyzer cargo serde 1.0.144 de/::Visitorrust-analyzer cargo serde 1.0.144 de/Visitor#<'de>, |
| 344 | { |
| 345 | if let Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(offset) = self.readrust-analyzer cargo serde_cbor_2 0.13.0 de/Deserializer#read..offsetrust-analyzer cargo serde_cbor_2 0.13.0 read/Read#offset().().checked_addrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[u64]checked_add().(len as u64) { |
| 346 | match self.readrust-analyzer cargo serde_cbor_2 0.13.0 de/Deserializer#read..readrust-analyzer cargo serde_cbor_2 0.13.0 read/Read#read().(len)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch(). { |
| 347 | EitherLifetimerust-analyzer cargo serde_cbor_2 0.13.0 read/EitherLifetime#::Longrust-analyzer cargo serde_cbor_2 0.13.0 read/EitherLifetime#Long#(buf) => { |
| 348 | let s = Selfrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]::convert_strrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]convert_str().(buf, offset)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 349 | visitor.visit_borrowed_strrust-analyzer cargo serde 1.0.144 de/Visitor#visit_borrowed_str().(s) |
| 350 | } |
| 351 | EitherLifetimerust-analyzer cargo serde_cbor_2 0.13.0 read/EitherLifetime#::Shortrust-analyzer cargo serde_cbor_2 0.13.0 read/EitherLifetime#Short#(buf) => { |
| 352 | let s = Selfrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]::convert_strrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]convert_str().(buf, offset)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 353 | visitor.visit_strrust-analyzer cargo serde 1.0.144 de/Visitor#visit_str().(s) |
| 354 | } |
| 355 | } |
| 356 | } else { |
| 357 | // An overflow would have occured. |
| 358 | Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(Errorrust-analyzer cargo serde_cbor_2 0.13.0 error/Error#::syntaxrust-analyzer cargo serde_cbor_2 0.13.0 error/impl#[Error]syntax().( |
| 359 | ErrorCoderust-analyzer cargo serde_cbor_2 0.13.0 error/ErrorCode#::LengthOutOfRangerust-analyzer cargo serde_cbor_2 0.13.0 error/ErrorCode#LengthOutOfRange#, |
| 360 | self.readrust-analyzer cargo serde_cbor_2 0.13.0 de/Deserializer#read..offsetrust-analyzer cargo serde_cbor_2 0.13.0 read/Read#offset().(), |
| 361 | )) |
| 362 | } |
| 363 | } |
| 364 | |
| 365 | fn parse_indefinite_strrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]parse_indefinite_str().<V>(&mut self, visitor: V) -> Resultrust-analyzer cargo serde_cbor_2 0.13.0 error/Result#<V::Valuerust-analyzer cargo serde 1.0.144 de/Visitor#Value#> |
| 366 | where |
| 367 | V: derust-analyzer cargo serde 1.0.144 de/::Visitorrust-analyzer cargo serde 1.0.144 de/Visitor#<'de>, |
| 368 | { |
| 369 | self.readrust-analyzer cargo serde_cbor_2 0.13.0 de/Deserializer#read..clear_bufferrust-analyzer cargo serde_cbor_2 0.13.0 read/Read#clear_buffer().(); |
| 370 | loop { |
| 371 | let byte = self.parse_u8rust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]parse_u8().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 372 | let len = match byte { |
| 373 | 0x60..=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeInclusive#0x77 => byte as usize rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().0x60, |
| 374 | 0x78 => self.parse_u8rust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]parse_u8().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch(). as usize, |
| 375 | 0x79 => self.parse_u16rust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]parse_u16().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch(). as usize, |
| 376 | 0x7a => self.parse_u32rust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]parse_u32().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch(). as usize, |
| 377 | 0x7b => { |
| 378 | let len = self.parse_u64rust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]parse_u64().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 379 | if len rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u64][`PartialOrd<Self>`]gt().>rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u64][`PartialOrd<Self>`]gt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u64][`PartialOrd<Self>`]gt().usize::MAXrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[usize]MAX. as u64 { |
| 380 | return Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(self.errorrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]error().(ErrorCoderust-analyzer cargo serde_cbor_2 0.13.0 error/ErrorCode#::LengthOutOfRangerust-analyzer cargo serde_cbor_2 0.13.0 error/ErrorCode#LengthOutOfRange#)); |
| 381 | } |
| 382 | len as usize |
| 383 | } |
| 384 | 0xff => break, |
| 385 | _ => return Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(self.errorrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]error().(ErrorCoderust-analyzer cargo serde_cbor_2 0.13.0 error/ErrorCode#::UnexpectedCoderust-analyzer cargo serde_cbor_2 0.13.0 error/ErrorCode#UnexpectedCode#)), |
| 386 | }; |
| 387 | |
| 388 | self.readrust-analyzer cargo serde_cbor_2 0.13.0 de/Deserializer#read..read_to_bufferrust-analyzer cargo serde_cbor_2 0.13.0 read/Read#read_to_buffer().(len)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 389 | } |
| 390 | |
| 391 | let offset = self.readrust-analyzer cargo serde_cbor_2 0.13.0 de/Deserializer#read..offsetrust-analyzer cargo serde_cbor_2 0.13.0 read/Read#offset().(); |
| 392 | match self.readrust-analyzer cargo serde_cbor_2 0.13.0 de/Deserializer#read..take_bufferrust-analyzer cargo serde_cbor_2 0.13.0 read/Read#take_buffer().() { |
| 393 | EitherLifetimerust-analyzer cargo serde_cbor_2 0.13.0 read/EitherLifetime#::Longrust-analyzer cargo serde_cbor_2 0.13.0 read/EitherLifetime#Long#(buf) => { |
| 394 | let s = Selfrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]::convert_strrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]convert_str().(buf, offset)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 395 | visitor.visit_borrowed_strrust-analyzer cargo serde 1.0.144 de/Visitor#visit_borrowed_str().(s) |
| 396 | } |
| 397 | EitherLifetimerust-analyzer cargo serde_cbor_2 0.13.0 read/EitherLifetime#::Shortrust-analyzer cargo serde_cbor_2 0.13.0 read/EitherLifetime#Short#(buf) => { |
| 398 | let s = Selfrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]::convert_strrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]convert_str().(buf, offset)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 399 | visitor.visit_strrust-analyzer cargo serde 1.0.144 de/Visitor#visit_str().(s) |
| 400 | } |
| 401 | } |
| 402 | } |
| 403 | |
| 404 | #[cfg(feature = "tags")] |
| 405 | fn handle_tagged_valuerust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]handle_tagged_value().<V>(&mut self, tag: u64, visitor: V) -> Resultrust-analyzer cargo serde_cbor_2 0.13.0 error/Result#<V::Valuerust-analyzer cargo serde 1.0.144 de/Visitor#Value#> |
| 406 | where |
| 407 | V: derust-analyzer cargo serde 1.0.144 de/::Visitorrust-analyzer cargo serde 1.0.144 de/Visitor#<'de>, |
| 408 | { |
| 409 | self.recursion_checkedrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]recursion_checked().(|d| { |
| 410 | set_tagrust-analyzer cargo serde_cbor_2 0.13.0 tags/set_tag().(Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(tag)); |
| 411 | let r = visitor.visit_newtype_structrust-analyzer cargo serde 1.0.144 de/Visitor#visit_newtype_struct().(d); |
| 412 | set_tagrust-analyzer cargo serde_cbor_2 0.13.0 tags/set_tag().(Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#); |
| 413 | r |
| 414 | }) |
| 415 | } |
| 416 | |
| 417 | #[cfg(not(feature = "tags"))] |
| 418 | fn handle_tagged_value<V>(&mut self, _tag: u64, visitor: V) -> Resultrust-analyzer cargo serde_cbor_2 0.13.0 error/Result#<V::Value> |
| 419 | where |
| 420 | V: derust-analyzer cargo serde 1.0.144 de/::Visitorrust-analyzer cargo serde 1.0.144 de/Visitor#<'de>, |
| 421 | { |
| 422 | selfrust-analyzer cargo serde_cbor_2 0.13.0 de/.recursion_checked(|de| derust-analyzer cargo serde 1.0.144 de/.parse_value(visitor)) |
| 423 | } |
| 424 | |
| 425 | fn recursion_checkedrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]recursion_checked().<F, T>(&mut self, f: F) -> Resultrust-analyzer cargo serde_cbor_2 0.13.0 error/Result#<T> |
| 426 | where |
| 427 | F: FnOncerust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/function/FnOnce#(&mut Deserializerrust-analyzer cargo serde_cbor_2 0.13.0 de/Deserializer#<R>) -> Resultrust-analyzer cargo serde_cbor_2 0.13.0 error/Result#<T>, |
| 428 | { |
| 429 | self.remaining_depthrust-analyzer cargo serde_cbor_2 0.13.0 de/Deserializer#remaining_depth. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u8][`SubAssign<Self>`]sub_assign().-=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u8][`SubAssign<Self>`]sub_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u8][`SubAssign<Self>`]sub_assign().1; |
| 430 | if self.remaining_depthrust-analyzer cargo serde_cbor_2 0.13.0 de/Deserializer#remaining_depth. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u8][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u8][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u8][`PartialEq<Self>`]eq().0 { |
| 431 | return Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(self.errorrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]error().(ErrorCoderust-analyzer cargo serde_cbor_2 0.13.0 error/ErrorCode#::RecursionLimitExceededrust-analyzer cargo serde_cbor_2 0.13.0 error/ErrorCode#RecursionLimitExceeded#)); |
| 432 | } |
| 433 | let r = f(self); |
| 434 | self.remaining_depthrust-analyzer cargo serde_cbor_2 0.13.0 de/Deserializer#remaining_depth. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u8][`AddAssign<Self>`]add_assign().+=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u8][`AddAssign<Self>`]add_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u8][`AddAssign<Self>`]add_assign().1; |
| 435 | r |
| 436 | } |
| 437 | |
| 438 | fn parse_arrayrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]parse_array().<V>(&mut self, mut len: usize, visitor: V) -> Resultrust-analyzer cargo serde_cbor_2 0.13.0 error/Result#<V::Valuerust-analyzer cargo serde 1.0.144 de/Visitor#Value#> |
| 439 | where |
| 440 | V: derust-analyzer cargo serde 1.0.144 de/::Visitorrust-analyzer cargo serde 1.0.144 de/Visitor#<'de>, |
| 441 | { |
| 442 | self.recursion_checkedrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]recursion_checked().(|de| { |
| 443 | let value = visitor.visit_seqrust-analyzer cargo serde 1.0.144 de/Visitor#visit_seq().(SeqAccessrust-analyzer cargo serde_cbor_2 0.13.0 de/SeqAccess# { derust-analyzer cargo serde_cbor_2 0.13.0 de/SeqAccess#de., lenrust-analyzer cargo serde_cbor_2 0.13.0 de/SeqAccess#len.: &mut len })?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 444 | |
| 445 | if len rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]ne().!=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]ne(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]ne().0 { |
| 446 | Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(de.errorrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]error().(ErrorCoderust-analyzer cargo serde_cbor_2 0.13.0 error/ErrorCode#::TrailingDatarust-analyzer cargo serde_cbor_2 0.13.0 error/ErrorCode#TrailingData#)) |
| 447 | } else { |
| 448 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(value) |
| 449 | } |
| 450 | }) |
| 451 | } |
| 452 | |
| 453 | fn parse_indefinite_arrayrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]parse_indefinite_array().<V>(&mut self, visitor: V) -> Resultrust-analyzer cargo serde_cbor_2 0.13.0 error/Result#<V::Valuerust-analyzer cargo serde 1.0.144 de/Visitor#Value#> |
| 454 | where |
| 455 | V: derust-analyzer cargo serde 1.0.144 de/::Visitorrust-analyzer cargo serde 1.0.144 de/Visitor#<'de>, |
| 456 | { |
| 457 | self.recursion_checkedrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]recursion_checked().(|de| { |
| 458 | let value = visitor.visit_seqrust-analyzer cargo serde 1.0.144 de/Visitor#visit_seq().(IndefiniteSeqAccessrust-analyzer cargo serde_cbor_2 0.13.0 de/IndefiniteSeqAccess# { derust-analyzer cargo serde_cbor_2 0.13.0 de/IndefiniteSeqAccess#de. })?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 459 | match de.nextrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]next().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch(). { |
| 460 | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(0xff) => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(value), |
| 461 | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(_) => Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(de.errorrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]error().(ErrorCoderust-analyzer cargo serde_cbor_2 0.13.0 error/ErrorCode#::TrailingDatarust-analyzer cargo serde_cbor_2 0.13.0 error/ErrorCode#TrailingData#)), |
| 462 | Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None# => Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(de.errorrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]error().(ErrorCoderust-analyzer cargo serde_cbor_2 0.13.0 error/ErrorCode#::EofWhileParsingArrayrust-analyzer cargo serde_cbor_2 0.13.0 error/ErrorCode#EofWhileParsingArray#)), |
| 463 | } |
| 464 | }) |
| 465 | } |
| 466 | |
| 467 | fn parse_maprust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]parse_map().<V>(&mut self, mut len: usize, visitor: V) -> Resultrust-analyzer cargo serde_cbor_2 0.13.0 error/Result#<V::Valuerust-analyzer cargo serde 1.0.144 de/Visitor#Value#> |
| 468 | where |
| 469 | V: derust-analyzer cargo serde 1.0.144 de/::Visitorrust-analyzer cargo serde 1.0.144 de/Visitor#<'de>, |
| 470 | { |
| 471 | let accept_packed = self.accept_packedrust-analyzer cargo serde_cbor_2 0.13.0 de/Deserializer#accept_packed.; |
| 472 | let accept_named = self.accept_namedrust-analyzer cargo serde_cbor_2 0.13.0 de/Deserializer#accept_named.; |
| 473 | self.recursion_checkedrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]recursion_checked().(|de| { |
| 474 | let value = visitor.visit_maprust-analyzer cargo serde 1.0.144 de/Visitor#visit_map().(MapAccessrust-analyzer cargo serde_cbor_2 0.13.0 de/MapAccess# { |
| 475 | derust-analyzer cargo serde_cbor_2 0.13.0 de/MapAccess#de., |
| 476 | lenrust-analyzer cargo serde_cbor_2 0.13.0 de/MapAccess#len.: &mut len, |
| 477 | accept_namedrust-analyzer cargo serde_cbor_2 0.13.0 de/MapAccess#accept_named., |
| 478 | accept_packedrust-analyzer cargo serde_cbor_2 0.13.0 de/MapAccess#accept_packed., |
| 479 | })?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 480 | |
| 481 | if len rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]ne().!=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]ne(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]ne().0 { |
| 482 | Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(de.errorrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]error().(ErrorCoderust-analyzer cargo serde_cbor_2 0.13.0 error/ErrorCode#::TrailingDatarust-analyzer cargo serde_cbor_2 0.13.0 error/ErrorCode#TrailingData#)) |
| 483 | } else { |
| 484 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(value) |
| 485 | } |
| 486 | }) |
| 487 | } |
| 488 | |
| 489 | fn parse_indefinite_maprust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]parse_indefinite_map().<V>(&mut self, visitor: V) -> Resultrust-analyzer cargo serde_cbor_2 0.13.0 error/Result#<V::Valuerust-analyzer cargo serde 1.0.144 de/Visitor#Value#> |
| 490 | where |
| 491 | V: derust-analyzer cargo serde 1.0.144 de/::Visitorrust-analyzer cargo serde 1.0.144 de/Visitor#<'de>, |
| 492 | { |
| 493 | let accept_named = self.accept_namedrust-analyzer cargo serde_cbor_2 0.13.0 de/Deserializer#accept_named.; |
| 494 | let accept_packed = self.accept_packedrust-analyzer cargo serde_cbor_2 0.13.0 de/Deserializer#accept_packed.; |
| 495 | self.recursion_checkedrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]recursion_checked().(|de| { |
| 496 | let value = visitor.visit_maprust-analyzer cargo serde 1.0.144 de/Visitor#visit_map().(IndefiniteMapAccessrust-analyzer cargo serde_cbor_2 0.13.0 de/IndefiniteMapAccess# { |
| 497 | derust-analyzer cargo serde_cbor_2 0.13.0 de/IndefiniteMapAccess#de., |
| 498 | accept_packedrust-analyzer cargo serde_cbor_2 0.13.0 de/IndefiniteMapAccess#accept_packed., |
| 499 | accept_namedrust-analyzer cargo serde_cbor_2 0.13.0 de/IndefiniteMapAccess#accept_named., |
| 500 | })?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 501 | match de.nextrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]next().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch(). { |
| 502 | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(0xff) => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(value), |
| 503 | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(_) => Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(de.errorrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]error().(ErrorCoderust-analyzer cargo serde_cbor_2 0.13.0 error/ErrorCode#::TrailingDatarust-analyzer cargo serde_cbor_2 0.13.0 error/ErrorCode#TrailingData#)), |
| 504 | Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None# => Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(de.errorrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]error().(ErrorCoderust-analyzer cargo serde_cbor_2 0.13.0 error/ErrorCode#::EofWhileParsingMaprust-analyzer cargo serde_cbor_2 0.13.0 error/ErrorCode#EofWhileParsingMap#)), |
| 505 | } |
| 506 | }) |
| 507 | } |
| 508 | |
| 509 | fn parse_enumrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]parse_enum().<V>(&mut self, mut len: usize, visitor: V) -> Resultrust-analyzer cargo serde_cbor_2 0.13.0 error/Result#<V::Valuerust-analyzer cargo serde 1.0.144 de/Visitor#Value#> |
| 510 | where |
| 511 | V: derust-analyzer cargo serde 1.0.144 de/::Visitorrust-analyzer cargo serde 1.0.144 de/Visitor#<'de>, |
| 512 | { |
| 513 | self.recursion_checkedrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]recursion_checked().(|de| { |
| 514 | let value = visitor.visit_enumrust-analyzer cargo serde 1.0.144 de/Visitor#visit_enum().(VariantAccessrust-analyzer cargo serde_cbor_2 0.13.0 de/VariantAccess# { |
| 515 | seqrust-analyzer cargo serde_cbor_2 0.13.0 de/VariantAccess#seq.: SeqAccessrust-analyzer cargo serde_cbor_2 0.13.0 de/SeqAccess# { derust-analyzer cargo serde_cbor_2 0.13.0 de/SeqAccess#de., lenrust-analyzer cargo serde_cbor_2 0.13.0 de/SeqAccess#len.: &mut len }, |
| 516 | })?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 517 | |
| 518 | if len rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]ne().!=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]ne(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]ne().0 { |
| 519 | Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(de.errorrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]error().(ErrorCoderust-analyzer cargo serde_cbor_2 0.13.0 error/ErrorCode#::TrailingDatarust-analyzer cargo serde_cbor_2 0.13.0 error/ErrorCode#TrailingData#)) |
| 520 | } else { |
| 521 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(value) |
| 522 | } |
| 523 | }) |
| 524 | } |
| 525 | |
| 526 | fn parse_enum_maprust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]parse_enum_map().<V>(&mut self, visitor: V) -> Resultrust-analyzer cargo serde_cbor_2 0.13.0 error/Result#<V::Valuerust-analyzer cargo serde 1.0.144 de/Visitor#Value#> |
| 527 | where |
| 528 | V: derust-analyzer cargo serde 1.0.144 de/::Visitorrust-analyzer cargo serde 1.0.144 de/Visitor#<'de>, |
| 529 | { |
| 530 | let accept_named = self.accept_namedrust-analyzer cargo serde_cbor_2 0.13.0 de/Deserializer#accept_named.; |
| 531 | let accept_packed = self.accept_packedrust-analyzer cargo serde_cbor_2 0.13.0 de/Deserializer#accept_packed.; |
| 532 | self.recursion_checkedrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]recursion_checked().(|de| { |
| 533 | let mut len = 1; |
| 534 | let value = visitor.visit_enumrust-analyzer cargo serde 1.0.144 de/Visitor#visit_enum().(VariantAccessMaprust-analyzer cargo serde_cbor_2 0.13.0 de/VariantAccessMap# { |
| 535 | maprust-analyzer cargo serde_cbor_2 0.13.0 de/VariantAccessMap#map.: MapAccessrust-analyzer cargo serde_cbor_2 0.13.0 de/MapAccess# { |
| 536 | derust-analyzer cargo serde_cbor_2 0.13.0 de/MapAccess#de., |
| 537 | lenrust-analyzer cargo serde_cbor_2 0.13.0 de/MapAccess#len.: &mut len, |
| 538 | accept_packedrust-analyzer cargo serde_cbor_2 0.13.0 de/MapAccess#accept_packed., |
| 539 | accept_namedrust-analyzer cargo serde_cbor_2 0.13.0 de/MapAccess#accept_named., |
| 540 | }, |
| 541 | })?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 542 | |
| 543 | if len rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]ne().!=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]ne(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]ne().0 { |
| 544 | Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(de.errorrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]error().(ErrorCoderust-analyzer cargo serde_cbor_2 0.13.0 error/ErrorCode#::TrailingDatarust-analyzer cargo serde_cbor_2 0.13.0 error/ErrorCode#TrailingData#)) |
| 545 | } else { |
| 546 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(value) |
| 547 | } |
| 548 | }) |
| 549 | } |
| 550 | |
| 551 | fn parse_indefinite_enumrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]parse_indefinite_enum().<V>(&mut self, visitor: V) -> Resultrust-analyzer cargo serde_cbor_2 0.13.0 error/Result#<V::Valuerust-analyzer cargo serde 1.0.144 de/Visitor#Value#> |
| 552 | where |
| 553 | V: derust-analyzer cargo serde 1.0.144 de/::Visitorrust-analyzer cargo serde 1.0.144 de/Visitor#<'de>, |
| 554 | { |
| 555 | self.recursion_checkedrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]recursion_checked().(|de| { |
| 556 | let value = visitor.visit_enumrust-analyzer cargo serde 1.0.144 de/Visitor#visit_enum().(VariantAccessrust-analyzer cargo serde_cbor_2 0.13.0 de/VariantAccess# { |
| 557 | seqrust-analyzer cargo serde_cbor_2 0.13.0 de/VariantAccess#seq.: IndefiniteSeqAccessrust-analyzer cargo serde_cbor_2 0.13.0 de/IndefiniteSeqAccess# { derust-analyzer cargo serde_cbor_2 0.13.0 de/IndefiniteSeqAccess#de. }, |
| 558 | })?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 559 | match de.nextrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]next().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch(). { |
| 560 | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(0xff) => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(value), |
| 561 | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(_) => Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(de.errorrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]error().(ErrorCoderust-analyzer cargo serde_cbor_2 0.13.0 error/ErrorCode#::TrailingDatarust-analyzer cargo serde_cbor_2 0.13.0 error/ErrorCode#TrailingData#)), |
| 562 | Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None# => Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(de.errorrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]error().(ErrorCoderust-analyzer cargo serde_cbor_2 0.13.0 error/ErrorCode#::EofWhileParsingArrayrust-analyzer cargo serde_cbor_2 0.13.0 error/ErrorCode#EofWhileParsingArray#)), |
| 563 | } |
| 564 | }) |
| 565 | } |
| 566 | |
| 567 | fn parse_f16rust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]parse_f16().(&mut self) -> Resultrust-analyzer cargo serde_cbor_2 0.13.0 error/Result#<f32> { |
| 568 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(f32::fromrust-analyzer cargo half 2.6.0 binary16/impl#[f32][`From<f16>`]from().(f16rust-analyzer cargo half 2.6.0 binary16/f16#::from_bitsrust-analyzer cargo half 2.6.0 binary16/impl#[f16]from_bits().(self.parse_u16rust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]parse_u16().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().))) |
| 569 | } |
| 570 | |
| 571 | fn parse_f32rust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]parse_f32().(&mut self) -> Resultrust-analyzer cargo serde_cbor_2 0.13.0 error/Result#<f32> { |
| 572 | self.parse_u32rust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]parse_u32().().maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]map().(f32::from_bitsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/impl#[f32]from_bits().) |
| 573 | } |
| 574 | |
| 575 | fn parse_f64rust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]parse_f64().(&mut self) -> Resultrust-analyzer cargo serde_cbor_2 0.13.0 error/Result#<f64> { |
| 576 | self.parse_u64rust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]parse_u64().().maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]map().(f64::from_bitsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f64/impl#[f64]from_bits().) |
| 577 | } |
| 578 | |
| 579 | // Don't warn about the `unreachable!` in case |
| 580 | // exhaustive integer pattern matching is enabled. |
| 581 | #[allow(unreachable_patterns)] |
| 582 | fn parse_valuerust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]parse_value().<V>(&mut self, visitor: V) -> Resultrust-analyzer cargo serde_cbor_2 0.13.0 error/Result#<V::Valuerust-analyzer cargo serde 1.0.144 de/Visitor#Value#> |
| 583 | where |
| 584 | V: derust-analyzer cargo serde 1.0.144 de/::Visitorrust-analyzer cargo serde 1.0.144 de/Visitor#<'de>, |
| 585 | { |
| 586 | let byte = self.parse_u8rust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]parse_u8().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 587 | match byte { |
| 588 | // Major type 0: an unsigned integer |
| 589 | 0x00..=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeInclusive#0x17 => visitor.visit_u8rust-analyzer cargo serde 1.0.144 de/Visitor#visit_u8().(byte), |
| 590 | 0x18 => { |
| 591 | let value = self.parse_u8rust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]parse_u8().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 592 | visitor.visit_u8rust-analyzer cargo serde 1.0.144 de/Visitor#visit_u8().(value) |
| 593 | } |
| 594 | 0x19 => { |
| 595 | let value = self.parse_u16rust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]parse_u16().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 596 | visitor.visit_u16rust-analyzer cargo serde 1.0.144 de/Visitor#visit_u16().(value) |
| 597 | } |
| 598 | 0x1a => { |
| 599 | let value = self.parse_u32rust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]parse_u32().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 600 | visitor.visit_u32rust-analyzer cargo serde 1.0.144 de/Visitor#visit_u32().(value) |
| 601 | } |
| 602 | 0x1b => { |
| 603 | let value = self.parse_u64rust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]parse_u64().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 604 | visitor.visit_u64rust-analyzer cargo serde 1.0.144 de/Visitor#visit_u64().(value) |
| 605 | } |
| 606 | 0x1c..=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeInclusive#0x1f => Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(self.errorrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]error().(ErrorCoderust-analyzer cargo serde_cbor_2 0.13.0 error/ErrorCode#::UnassignedCoderust-analyzer cargo serde_cbor_2 0.13.0 error/ErrorCode#UnassignedCode#)), |
| 607 | |
| 608 | // Major type 1: a negative integer |
| 609 | 0x20..=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeInclusive#0x37 => visitor.visit_i8rust-analyzer cargo serde 1.0.144 de/Visitor#visit_i8().(-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i8][Neg]neg().1 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i8][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i8][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i8][`Sub<Self>`]sub().(byte rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u8][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u8][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u8][`Sub<Self>`]sub().0x20) as i8), |
| 610 | 0x38 => { |
| 611 | let value = self.parse_u8rust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]parse_u8().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 612 | visitor.visit_i16rust-analyzer cargo serde 1.0.144 de/Visitor#visit_i16().(-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i16][Neg]neg().1 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i16][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i16][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i16][`Sub<Self>`]sub().i16::fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/num/impl#[i16][`From<u8>`]from().(value)) |
| 613 | } |
| 614 | 0x39 => { |
| 615 | let value = self.parse_u16rust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]parse_u16().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 616 | visitor.visit_i32rust-analyzer cargo serde 1.0.144 de/Visitor#visit_i32().(-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][Neg]neg().1 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`Sub<Self>`]sub().i32::fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/num/impl#[i32][`From<u16>`]from().(value)) |
| 617 | } |
| 618 | 0x3a => { |
| 619 | let value = self.parse_u32rust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]parse_u32().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 620 | visitor.visit_i64rust-analyzer cargo serde 1.0.144 de/Visitor#visit_i64().(-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][Neg]neg().1 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Sub<Self>`]sub().i64::fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/num/impl#[i64][`From<u32>`]from().(value)) |
| 621 | } |
| 622 | 0x3b => { |
| 623 | let value = self.parse_u64rust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]parse_u64().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 624 | if value rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u64][`PartialOrd<Self>`]gt().>rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u64][`PartialOrd<Self>`]gt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u64][`PartialOrd<Self>`]gt().i64::MAXrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[i64]MAX. as u64 { |
| 625 | return visitor.visit_i128rust-analyzer cargo serde 1.0.144 de/Visitor#visit_i128().(-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i128][Neg]neg().1 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i128][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i128][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i128][`Sub<Self>`]sub().i128::fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/num/impl#[i128][`From<u64>`]from().(value)); |
| 626 | } |
| 627 | visitor.visit_i64rust-analyzer cargo serde 1.0.144 de/Visitor#visit_i64().(-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][Neg]neg().1 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Sub<Self>`]sub().value as i64) |
| 628 | } |
| 629 | 0x3c..=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeInclusive#0x3f => Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(self.errorrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]error().(ErrorCoderust-analyzer cargo serde_cbor_2 0.13.0 error/ErrorCode#::UnassignedCoderust-analyzer cargo serde_cbor_2 0.13.0 error/ErrorCode#UnassignedCode#)), |
| 630 | |
| 631 | // Major type 2: a byte string |
| 632 | 0x40..=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeInclusive#0x57 => self.parse_bytesrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]parse_bytes().(byte as usize rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().0x40, visitor), |
| 633 | 0x58 => { |
| 634 | let len = self.parse_u8rust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]parse_u8().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 635 | self.parse_bytesrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]parse_bytes().(len as usize, visitor) |
| 636 | } |
| 637 | 0x59 => { |
| 638 | let len = self.parse_u16rust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]parse_u16().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 639 | self.parse_bytesrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]parse_bytes().(len as usize, visitor) |
| 640 | } |
| 641 | 0x5a => { |
| 642 | let len = self.parse_u32rust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]parse_u32().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 643 | self.parse_bytesrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]parse_bytes().(len as usize, visitor) |
| 644 | } |
| 645 | 0x5b => { |
| 646 | let len = self.parse_u64rust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]parse_u64().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 647 | if len rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u64][`PartialOrd<Self>`]gt().>rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u64][`PartialOrd<Self>`]gt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u64][`PartialOrd<Self>`]gt().usize::MAXrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[usize]MAX. as u64 { |
| 648 | return Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(self.errorrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]error().(ErrorCoderust-analyzer cargo serde_cbor_2 0.13.0 error/ErrorCode#::LengthOutOfRangerust-analyzer cargo serde_cbor_2 0.13.0 error/ErrorCode#LengthOutOfRange#)); |
| 649 | } |
| 650 | self.parse_bytesrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]parse_bytes().(len as usize, visitor) |
| 651 | } |
| 652 | 0x5c..=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeInclusive#0x5e => Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(self.errorrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]error().(ErrorCoderust-analyzer cargo serde_cbor_2 0.13.0 error/ErrorCode#::UnassignedCoderust-analyzer cargo serde_cbor_2 0.13.0 error/ErrorCode#UnassignedCode#)), |
| 653 | 0x5f => self.parse_indefinite_bytesrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]parse_indefinite_bytes().(visitor), |
| 654 | |
| 655 | // Major type 3: a text string |
| 656 | 0x60..=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeInclusive#0x77 => self.parse_strrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]parse_str().(byte as usize rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().0x60, visitor), |
| 657 | 0x78 => { |
| 658 | let len = self.parse_u8rust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]parse_u8().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 659 | self.parse_strrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]parse_str().(len as usize, visitor) |
| 660 | } |
| 661 | 0x79 => { |
| 662 | let len = self.parse_u16rust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]parse_u16().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 663 | self.parse_strrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]parse_str().(len as usize, visitor) |
| 664 | } |
| 665 | 0x7a => { |
| 666 | let len = self.parse_u32rust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]parse_u32().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 667 | self.parse_strrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]parse_str().(len as usize, visitor) |
| 668 | } |
| 669 | 0x7b => { |
| 670 | let len = self.parse_u64rust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]parse_u64().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 671 | if len rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u64][`PartialOrd<Self>`]gt().>rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u64][`PartialOrd<Self>`]gt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u64][`PartialOrd<Self>`]gt().usize::MAXrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[usize]MAX. as u64 { |
| 672 | return Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(self.errorrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]error().(ErrorCoderust-analyzer cargo serde_cbor_2 0.13.0 error/ErrorCode#::LengthOutOfRangerust-analyzer cargo serde_cbor_2 0.13.0 error/ErrorCode#LengthOutOfRange#)); |
| 673 | } |
| 674 | self.parse_strrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]parse_str().(len as usize, visitor) |
| 675 | } |
| 676 | 0x7c..=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeInclusive#0x7e => Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(self.errorrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]error().(ErrorCoderust-analyzer cargo serde_cbor_2 0.13.0 error/ErrorCode#::UnassignedCoderust-analyzer cargo serde_cbor_2 0.13.0 error/ErrorCode#UnassignedCode#)), |
| 677 | 0x7f => self.parse_indefinite_strrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]parse_indefinite_str().(visitor), |
| 678 | |
| 679 | // Major type 4: an array of data items |
| 680 | 0x80..=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeInclusive#0x97 => self.parse_arrayrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]parse_array().(byte as usize rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().0x80, visitor), |
| 681 | 0x98 => { |
| 682 | let len = self.parse_u8rust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]parse_u8().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 683 | self.parse_arrayrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]parse_array().(len as usize, visitor) |
| 684 | } |
| 685 | 0x99 => { |
| 686 | let len = self.parse_u16rust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]parse_u16().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 687 | self.parse_arrayrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]parse_array().(len as usize, visitor) |
| 688 | } |
| 689 | 0x9a => { |
| 690 | let len = self.parse_u32rust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]parse_u32().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 691 | self.parse_arrayrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]parse_array().(len as usize, visitor) |
| 692 | } |
| 693 | 0x9b => { |
| 694 | let len = self.parse_u64rust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]parse_u64().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 695 | if len rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u64][`PartialOrd<Self>`]gt().>rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u64][`PartialOrd<Self>`]gt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u64][`PartialOrd<Self>`]gt().usize::MAXrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[usize]MAX. as u64 { |
| 696 | return Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(self.errorrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]error().(ErrorCoderust-analyzer cargo serde_cbor_2 0.13.0 error/ErrorCode#::LengthOutOfRangerust-analyzer cargo serde_cbor_2 0.13.0 error/ErrorCode#LengthOutOfRange#)); |
| 697 | } |
| 698 | self.parse_arrayrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]parse_array().(len as usize, visitor) |
| 699 | } |
| 700 | 0x9c..=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeInclusive#0x9e => Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(self.errorrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]error().(ErrorCoderust-analyzer cargo serde_cbor_2 0.13.0 error/ErrorCode#::UnassignedCoderust-analyzer cargo serde_cbor_2 0.13.0 error/ErrorCode#UnassignedCode#)), |
| 701 | 0x9f => self.parse_indefinite_arrayrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]parse_indefinite_array().(visitor), |
| 702 | |
| 703 | // Major type 5: a map of pairs of data items |
| 704 | 0xa0..=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeInclusive#0xb7 => self.parse_maprust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]parse_map().(byte as usize rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().0xa0, visitor), |
| 705 | 0xb8 => { |
| 706 | let len = self.parse_u8rust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]parse_u8().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 707 | self.parse_maprust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]parse_map().(len as usize, visitor) |
| 708 | } |
| 709 | 0xb9 => { |
| 710 | let len = self.parse_u16rust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]parse_u16().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 711 | self.parse_maprust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]parse_map().(len as usize, visitor) |
| 712 | } |
| 713 | 0xba => { |
| 714 | let len = self.parse_u32rust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]parse_u32().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 715 | self.parse_maprust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]parse_map().(len as usize, visitor) |
| 716 | } |
| 717 | 0xbb => { |
| 718 | let len = self.parse_u64rust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]parse_u64().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 719 | if len rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u64][`PartialOrd<Self>`]gt().>rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u64][`PartialOrd<Self>`]gt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u64][`PartialOrd<Self>`]gt().usize::MAXrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[usize]MAX. as u64 { |
| 720 | return Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(self.errorrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]error().(ErrorCoderust-analyzer cargo serde_cbor_2 0.13.0 error/ErrorCode#::LengthOutOfRangerust-analyzer cargo serde_cbor_2 0.13.0 error/ErrorCode#LengthOutOfRange#)); |
| 721 | } |
| 722 | self.parse_maprust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]parse_map().(len as usize, visitor) |
| 723 | } |
| 724 | 0xbc..=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeInclusive#0xbe => Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(self.errorrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]error().(ErrorCoderust-analyzer cargo serde_cbor_2 0.13.0 error/ErrorCode#::UnassignedCoderust-analyzer cargo serde_cbor_2 0.13.0 error/ErrorCode#UnassignedCode#)), |
| 725 | 0xbf => self.parse_indefinite_maprust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]parse_indefinite_map().(visitor), |
| 726 | |
| 727 | // Major type 6: optional semantic tagging of other major types |
| 728 | 0xc0..=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeInclusive#0xd7 => { |
| 729 | let tag = u64::fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/num/impl#[u64][`From<u8>`]from().(byte) rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`Sub<Self>`]sub().0xc0; |
| 730 | self.handle_tagged_valuerust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]handle_tagged_value().(tag, visitor) |
| 731 | } |
| 732 | 0xd8 => { |
| 733 | let tag = self.parse_u8rust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]parse_u8().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 734 | self.handle_tagged_valuerust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]handle_tagged_value().(tag.intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().(), visitor) |
| 735 | } |
| 736 | 0xd9 => { |
| 737 | let tag = self.parse_u16rust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]parse_u16().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 738 | self.handle_tagged_valuerust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]handle_tagged_value().(tag.intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().(), visitor) |
| 739 | } |
| 740 | 0xda => { |
| 741 | let tag = self.parse_u32rust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]parse_u32().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 742 | self.handle_tagged_valuerust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]handle_tagged_value().(tag.intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().(), visitor) |
| 743 | } |
| 744 | 0xdb => { |
| 745 | let tag = self.parse_u64rust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]parse_u64().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 746 | self.handle_tagged_valuerust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]handle_tagged_value().(tag, visitor) |
| 747 | } |
| 748 | 0xdc..=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeInclusive#0xdf => Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(self.errorrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]error().(ErrorCoderust-analyzer cargo serde_cbor_2 0.13.0 error/ErrorCode#::UnassignedCoderust-analyzer cargo serde_cbor_2 0.13.0 error/ErrorCode#UnassignedCode#)), |
| 749 | |
| 750 | // Major type 7: floating-point numbers and other simple data types that need no content |
| 751 | 0xe0..=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeInclusive#0xf3 => Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(self.errorrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]error().(ErrorCoderust-analyzer cargo serde_cbor_2 0.13.0 error/ErrorCode#::UnassignedCoderust-analyzer cargo serde_cbor_2 0.13.0 error/ErrorCode#UnassignedCode#)), |
| 752 | 0xf4 => visitor.visit_boolrust-analyzer cargo serde 1.0.144 de/Visitor#visit_bool().(false), |
| 753 | 0xf5 => visitor.visit_boolrust-analyzer cargo serde 1.0.144 de/Visitor#visit_bool().(true), |
| 754 | 0xf6 => visitor.visit_unitrust-analyzer cargo serde 1.0.144 de/Visitor#visit_unit().(), |
| 755 | 0xf7 => visitor.visit_unitrust-analyzer cargo serde 1.0.144 de/Visitor#visit_unit().(), |
| 756 | 0xf8 => Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(self.errorrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]error().(ErrorCoderust-analyzer cargo serde_cbor_2 0.13.0 error/ErrorCode#::UnassignedCoderust-analyzer cargo serde_cbor_2 0.13.0 error/ErrorCode#UnassignedCode#)), |
| 757 | 0xf9 => { |
| 758 | let value = self.parse_f16rust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]parse_f16().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 759 | visitor.visit_f32rust-analyzer cargo serde 1.0.144 de/Visitor#visit_f32().(value) |
| 760 | } |
| 761 | 0xfa => { |
| 762 | let value = self.parse_f32rust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]parse_f32().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 763 | visitor.visit_f32rust-analyzer cargo serde 1.0.144 de/Visitor#visit_f32().(value) |
| 764 | } |
| 765 | 0xfb => { |
| 766 | let value = self.parse_f64rust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]parse_f64().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 767 | visitor.visit_f64rust-analyzer cargo serde 1.0.144 de/Visitor#visit_f64().(value) |
| 768 | } |
| 769 | 0xfc..=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeInclusive#0xfe => Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(self.errorrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]error().(ErrorCoderust-analyzer cargo serde_cbor_2 0.13.0 error/ErrorCode#::UnassignedCoderust-analyzer cargo serde_cbor_2 0.13.0 error/ErrorCode#UnassignedCode#)), |
| 770 | 0xff => Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(self.errorrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]error().(ErrorCoderust-analyzer cargo serde_cbor_2 0.13.0 error/ErrorCode#::UnexpectedCoderust-analyzer cargo serde_cbor_2 0.13.0 error/ErrorCode#UnexpectedCode#)), |
| 771 | |
| 772 | _ => unreachablerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/unreachable!!(), |
| 773 | } |
| 774 | } |
| 775 | } |
| 776 | |
| 777 | impl<'de, R> derust-analyzer cargo serde 1.0.144 de/::Deserializerrust-analyzer cargo serde 1.0.144 de/Deserializer#<'de> for &mut Deserializerrust-analyzer cargo serde_cbor_2 0.13.0 de/Deserializer#<R> |
| 778 | where |
| 779 | R: Readrust-analyzer cargo serde_cbor_2 0.13.0 read/Read#<'de>, |
| 780 | { |
| 781 | type Errorrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`&mut Deserializer<R>`][`Deserializer<'de>`]Error# = Errorrust-analyzer cargo serde_cbor_2 0.13.0 error/Error#; |
| 782 | |
| 783 | #[inline] |
| 784 | fn deserialize_anyrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`&mut Deserializer<R>`][`Deserializer<'de>`]deserialize_any().<V>(self, visitor: V) -> Resultrust-analyzer cargo serde_cbor_2 0.13.0 error/Result#<V::Valuerust-analyzer cargo serde 1.0.144 de/Visitor#Value#> |
| 785 | where |
| 786 | V: derust-analyzer cargo serde 1.0.144 de/::Visitorrust-analyzer cargo serde 1.0.144 de/Visitor#<'de>, |
| 787 | { |
| 788 | self.parse_valuerust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]parse_value().(visitor) |
| 789 | } |
| 790 | |
| 791 | #[inline] |
| 792 | fn deserialize_optionrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`&mut Deserializer<R>`][`Deserializer<'de>`]deserialize_option().<V>(self, visitor: V) -> Resultrust-analyzer cargo serde_cbor_2 0.13.0 error/Result#<V::Valuerust-analyzer cargo serde 1.0.144 de/Visitor#Value#> |
| 793 | where |
| 794 | V: derust-analyzer cargo serde 1.0.144 de/::Visitorrust-analyzer cargo serde 1.0.144 de/Visitor#<'de>, |
| 795 | { |
| 796 | match self.peekrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]peek().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch(). { |
| 797 | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(0xf6) => { |
| 798 | self.consumerust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]consume().(); |
| 799 | visitor.visit_nonerust-analyzer cargo serde 1.0.144 de/Visitor#visit_none().() |
| 800 | } |
| 801 | _ => visitor.visit_somerust-analyzer cargo serde 1.0.144 de/Visitor#visit_some().(self), |
| 802 | } |
| 803 | } |
| 804 | |
| 805 | #[inline] |
| 806 | fn deserialize_newtype_structrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`&mut Deserializer<R>`][`Deserializer<'de>`]deserialize_newtype_struct().<V>(self, _name: &str, visitor: V) -> Resultrust-analyzer cargo serde_cbor_2 0.13.0 error/Result#<V::Valuerust-analyzer cargo serde 1.0.144 de/Visitor#Value#> |
| 807 | where |
| 808 | V: derust-analyzer cargo serde 1.0.144 de/::Visitorrust-analyzer cargo serde 1.0.144 de/Visitor#<'de>, |
| 809 | { |
| 810 | visitor.visit_newtype_structrust-analyzer cargo serde 1.0.144 de/Visitor#visit_newtype_struct().(self) |
| 811 | } |
| 812 | |
| 813 | // Unit variants are encoded as just the variant identifier. |
| 814 | // Tuple variants are encoded as an array of the variant identifier followed by the fields. |
| 815 | // Struct variants are encoded as an array of the variant identifier followed by the struct. |
| 816 | #[inline] |
| 817 | fn deserialize_enumrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`&mut Deserializer<R>`][`Deserializer<'de>`]deserialize_enum().<V>( |
| 818 | self, |
| 819 | _name: &str, |
| 820 | _variants: &'static [&'static str], |
| 821 | visitor: V, |
| 822 | ) -> Resultrust-analyzer cargo serde_cbor_2 0.13.0 error/Result#<V::Valuerust-analyzer cargo serde 1.0.144 de/Visitor#Value#> |
| 823 | where |
| 824 | V: derust-analyzer cargo serde 1.0.144 de/::Visitorrust-analyzer cargo serde 1.0.144 de/Visitor#<'de>, |
| 825 | { |
| 826 | match self.peekrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]peek().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch(). { |
| 827 | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(byte @ 0x80..=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeInclusive#0x9f) => { |
| 828 | if !rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().self.accept_legacy_enumsrust-analyzer cargo serde_cbor_2 0.13.0 de/Deserializer#accept_legacy_enums. { |
| 829 | return Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(self.errorrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]error().(ErrorCoderust-analyzer cargo serde_cbor_2 0.13.0 error/ErrorCode#::WrongEnumFormatrust-analyzer cargo serde_cbor_2 0.13.0 error/ErrorCode#WrongEnumFormat#)); |
| 830 | } |
| 831 | self.consumerust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]consume().(); |
| 832 | match byte { |
| 833 | 0x80..=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeInclusive#0x97 => self.parse_enumrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]parse_enum().(byte as usize rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().0x80, visitor), |
| 834 | 0x98 => { |
| 835 | let len = self.parse_u8rust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]parse_u8().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 836 | self.parse_enumrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]parse_enum().(len as usize, visitor) |
| 837 | } |
| 838 | 0x99 => { |
| 839 | let len = self.parse_u16rust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]parse_u16().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 840 | self.parse_enumrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]parse_enum().(len as usize, visitor) |
| 841 | } |
| 842 | 0x9a => { |
| 843 | let len = self.parse_u32rust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]parse_u32().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 844 | self.parse_enumrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]parse_enum().(len as usize, visitor) |
| 845 | } |
| 846 | 0x9b => { |
| 847 | let len = self.parse_u64rust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]parse_u64().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 848 | if len rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u64][`PartialOrd<Self>`]gt().>rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u64][`PartialOrd<Self>`]gt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u64][`PartialOrd<Self>`]gt().usize::MAXrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[usize]MAX. as u64 { |
| 849 | return Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(self.errorrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]error().(ErrorCoderust-analyzer cargo serde_cbor_2 0.13.0 error/ErrorCode#::LengthOutOfRangerust-analyzer cargo serde_cbor_2 0.13.0 error/ErrorCode#LengthOutOfRange#)); |
| 850 | } |
| 851 | self.parse_enumrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]parse_enum().(len as usize, visitor) |
| 852 | } |
| 853 | 0x9c..=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeInclusive#0x9e => Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(self.errorrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]error().(ErrorCoderust-analyzer cargo serde_cbor_2 0.13.0 error/ErrorCode#::UnassignedCoderust-analyzer cargo serde_cbor_2 0.13.0 error/ErrorCode#UnassignedCode#)), |
| 854 | 0x9f => self.parse_indefinite_enumrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]parse_indefinite_enum().(visitor), |
| 855 | |
| 856 | _ => unreachablerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/unreachable!!(), |
| 857 | } |
| 858 | } |
| 859 | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(0xa1) => { |
| 860 | if !rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().self.accept_standard_enumsrust-analyzer cargo serde_cbor_2 0.13.0 de/Deserializer#accept_standard_enums. { |
| 861 | return Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(self.errorrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]error().(ErrorCoderust-analyzer cargo serde_cbor_2 0.13.0 error/ErrorCode#::WrongEnumFormatrust-analyzer cargo serde_cbor_2 0.13.0 error/ErrorCode#WrongEnumFormat#)); |
| 862 | } |
| 863 | self.consumerust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]consume().(); |
| 864 | self.parse_enum_maprust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]parse_enum_map().(visitor) |
| 865 | } |
| 866 | Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None# => Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(self.errorrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]error().(ErrorCoderust-analyzer cargo serde_cbor_2 0.13.0 error/ErrorCode#::EofWhileParsingValuerust-analyzer cargo serde_cbor_2 0.13.0 error/ErrorCode#EofWhileParsingValue#)), |
| 867 | _ => { |
| 868 | if !rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().self.accept_standard_enumsrust-analyzer cargo serde_cbor_2 0.13.0 de/Deserializer#accept_standard_enums. && !rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().self.accept_legacy_enumsrust-analyzer cargo serde_cbor_2 0.13.0 de/Deserializer#accept_legacy_enums. { |
| 869 | return Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(self.errorrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]error().(ErrorCoderust-analyzer cargo serde_cbor_2 0.13.0 error/ErrorCode#::WrongEnumFormatrust-analyzer cargo serde_cbor_2 0.13.0 error/ErrorCode#WrongEnumFormat#)); |
| 870 | } |
| 871 | visitor.visit_enumrust-analyzer cargo serde 1.0.144 de/Visitor#visit_enum().(UnitVariantAccessrust-analyzer cargo serde_cbor_2 0.13.0 de/UnitVariantAccess# { derust-analyzer cargo serde_cbor_2 0.13.0 de/UnitVariantAccess#de.: self }) |
| 872 | } |
| 873 | } |
| 874 | } |
| 875 | |
| 876 | #[inline] |
| 877 | fn is_human_readablerust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`&mut Deserializer<R>`][`Deserializer<'de>`]is_human_readable().(&self) -> bool { |
| 878 | false |
| 879 | } |
| 880 | |
| 881 | serderust-analyzer cargo serde 1.0.144 crate/::forward_to_deserialize_anyrust-analyzer cargo serde 1.0.144 macros/forward_to_deserialize_any!! { |
| 882 | bool i8 i16 i32 i64 i128 u8 u16 u32 u64 u128 f32 f64 char str string unit |
| 883 | unit_struct seq tuple tuple_struct map struct identifier ignored_any |
| 884 | bytes byte_buf |
| 885 | } |
| 886 | } |
| 887 | |
| 888 | impl<R> Deserializerrust-analyzer cargo serde_cbor_2 0.13.0 de/Deserializer#<R> |
| 889 | where |
| 890 | R: Offsetrust-analyzer cargo serde_cbor_2 0.13.0 read/Offset#, |
| 891 | { |
| 892 | /// Return the current offset in the reader |
| 893 | #[inline] |
| 894 | pub fn byte_offsetrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]byte_offset().(&self) -> usize { |
| 895 | self.readrust-analyzer cargo serde_cbor_2 0.13.0 de/Deserializer#read..byte_offsetrust-analyzer cargo serde_cbor_2 0.13.0 read/Offset#byte_offset().() |
| 896 | } |
| 897 | } |
| 898 | |
| 899 | trait MakeErrorrust-analyzer cargo serde_cbor_2 0.13.0 de/MakeError# { |
| 900 | fn errorrust-analyzer cargo serde_cbor_2 0.13.0 de/MakeError#error().(&self, code: ErrorCoderust-analyzer cargo serde_cbor_2 0.13.0 error/ErrorCode#) -> Errorrust-analyzer cargo serde_cbor_2 0.13.0 error/Error#; |
| 901 | } |
| 902 | |
| 903 | struct SeqAccessrust-analyzer cargo serde_cbor_2 0.13.0 de/SeqAccess#<'a, R> { |
| 904 | derust-analyzer cargo serde_cbor_2 0.13.0 de/SeqAccess#de.: &'a mut Deserializerrust-analyzer cargo serde_cbor_2 0.13.0 de/Deserializer#<R>, |
| 905 | lenrust-analyzer cargo serde_cbor_2 0.13.0 de/SeqAccess#len.: &'a mut usize, |
| 906 | } |
| 907 | |
| 908 | impl<'de, R> derust-analyzer cargo serde 1.0.144 de/::SeqAccessrust-analyzer cargo serde 1.0.144 de/SeqAccess#<'de> for SeqAccessrust-analyzer cargo serde_cbor_2 0.13.0 de/SeqAccess#<'_, R> |
| 909 | where |
| 910 | R: Readrust-analyzer cargo serde_cbor_2 0.13.0 read/Read#<'de>, |
| 911 | { |
| 912 | type Errorrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`SeqAccess<'_, R>`][`SeqAccess<'de>`]Error# = Errorrust-analyzer cargo serde_cbor_2 0.13.0 error/Error#; |
| 913 | |
| 914 | fn next_element_seedrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`SeqAccess<'_, R>`][`SeqAccess<'de>`]next_element_seed().<T>(&mut self, seed: T) -> Resultrust-analyzer cargo serde_cbor_2 0.13.0 error/Result#<Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<T::Valuerust-analyzer cargo serde 1.0.144 de/DeserializeSeed#Value#>> |
| 915 | where |
| 916 | T: derust-analyzer cargo serde 1.0.144 de/::DeserializeSeedrust-analyzer cargo serde 1.0.144 de/DeserializeSeed#<'de>, |
| 917 | { |
| 918 | if *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&mut T`][Deref]deref().self.lenrust-analyzer cargo serde_cbor_2 0.13.0 de/SeqAccess#len. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]eq().0 { |
| 919 | return Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#); |
| 920 | } |
| 921 | *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&mut T`][Deref]deref().self.lenrust-analyzer cargo serde_cbor_2 0.13.0 de/SeqAccess#len. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`SubAssign<Self>`]sub_assign().-=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`SubAssign<Self>`]sub_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`SubAssign<Self>`]sub_assign().1; |
| 922 | |
| 923 | let value = seed.deserializerust-analyzer cargo serde 1.0.144 de/DeserializeSeed#deserialize().(&mut *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&mut T`][Deref]deref().self.derust-analyzer cargo serde_cbor_2 0.13.0 de/SeqAccess#de.)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 924 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(value)) |
| 925 | } |
| 926 | |
| 927 | fn size_hintrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`SeqAccess<'_, R>`][`SeqAccess<'de>`]size_hint().(&self) -> Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<usize> { |
| 928 | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&mut T`][Deref]deref().self.lenrust-analyzer cargo serde_cbor_2 0.13.0 de/SeqAccess#len.) |
| 929 | } |
| 930 | } |
| 931 | |
| 932 | impl<'de, R> MakeErrorrust-analyzer cargo serde_cbor_2 0.13.0 de/MakeError# for SeqAccessrust-analyzer cargo serde_cbor_2 0.13.0 de/SeqAccess#<'_, R> |
| 933 | where |
| 934 | R: Readrust-analyzer cargo serde_cbor_2 0.13.0 read/Read#<'de>, |
| 935 | { |
| 936 | fn errorrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`SeqAccess<'_, R>`][MakeError]error().(&self, code: ErrorCoderust-analyzer cargo serde_cbor_2 0.13.0 error/ErrorCode#) -> Errorrust-analyzer cargo serde_cbor_2 0.13.0 error/Error# { |
| 937 | self.derust-analyzer cargo serde_cbor_2 0.13.0 de/SeqAccess#de..errorrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]error().(code) |
| 938 | } |
| 939 | } |
| 940 | |
| 941 | struct IndefiniteSeqAccessrust-analyzer cargo serde_cbor_2 0.13.0 de/IndefiniteSeqAccess#<'a, R> { |
| 942 | derust-analyzer cargo serde_cbor_2 0.13.0 de/IndefiniteSeqAccess#de.: &'a mut Deserializerrust-analyzer cargo serde_cbor_2 0.13.0 de/Deserializer#<R>, |
| 943 | } |
| 944 | |
| 945 | impl<'de, R> derust-analyzer cargo serde 1.0.144 de/::SeqAccessrust-analyzer cargo serde 1.0.144 de/SeqAccess#<'de> for IndefiniteSeqAccessrust-analyzer cargo serde_cbor_2 0.13.0 de/IndefiniteSeqAccess#<'_, R> |
| 946 | where |
| 947 | R: Readrust-analyzer cargo serde_cbor_2 0.13.0 read/Read#<'de>, |
| 948 | { |
| 949 | type Errorrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`IndefiniteSeqAccess<'_, R>`][`SeqAccess<'de>`]Error# = Errorrust-analyzer cargo serde_cbor_2 0.13.0 error/Error#; |
| 950 | |
| 951 | fn next_element_seedrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`IndefiniteSeqAccess<'_, R>`][`SeqAccess<'de>`]next_element_seed().<T>(&mut self, seed: T) -> Resultrust-analyzer cargo serde_cbor_2 0.13.0 error/Result#<Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<T::Valuerust-analyzer cargo serde 1.0.144 de/DeserializeSeed#Value#>> |
| 952 | where |
| 953 | T: derust-analyzer cargo serde 1.0.144 de/::DeserializeSeedrust-analyzer cargo serde 1.0.144 de/DeserializeSeed#<'de>, |
| 954 | { |
| 955 | match self.derust-analyzer cargo serde_cbor_2 0.13.0 de/IndefiniteSeqAccess#de..peekrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]peek().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch(). { |
| 956 | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(0xff) => return Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#), |
| 957 | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(_) => {} |
| 958 | Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None# => return Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(self.derust-analyzer cargo serde_cbor_2 0.13.0 de/IndefiniteSeqAccess#de..errorrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]error().(ErrorCoderust-analyzer cargo serde_cbor_2 0.13.0 error/ErrorCode#::EofWhileParsingArrayrust-analyzer cargo serde_cbor_2 0.13.0 error/ErrorCode#EofWhileParsingArray#)), |
| 959 | } |
| 960 | |
| 961 | let value = seed.deserializerust-analyzer cargo serde 1.0.144 de/DeserializeSeed#deserialize().(&mut *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&mut T`][Deref]deref().self.derust-analyzer cargo serde_cbor_2 0.13.0 de/IndefiniteSeqAccess#de.)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 962 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(value)) |
| 963 | } |
| 964 | } |
| 965 | |
| 966 | impl<'de, R> MakeErrorrust-analyzer cargo serde_cbor_2 0.13.0 de/MakeError# for IndefiniteSeqAccessrust-analyzer cargo serde_cbor_2 0.13.0 de/IndefiniteSeqAccess#<'_, R> |
| 967 | where |
| 968 | R: Readrust-analyzer cargo serde_cbor_2 0.13.0 read/Read#<'de>, |
| 969 | { |
| 970 | fn errorrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`IndefiniteSeqAccess<'_, R>`][MakeError]error().(&self, code: ErrorCoderust-analyzer cargo serde_cbor_2 0.13.0 error/ErrorCode#) -> Errorrust-analyzer cargo serde_cbor_2 0.13.0 error/Error# { |
| 971 | self.derust-analyzer cargo serde_cbor_2 0.13.0 de/IndefiniteSeqAccess#de..errorrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]error().(code) |
| 972 | } |
| 973 | } |
| 974 | |
| 975 | struct MapAccessrust-analyzer cargo serde_cbor_2 0.13.0 de/MapAccess#<'a, R> { |
| 976 | derust-analyzer cargo serde_cbor_2 0.13.0 de/MapAccess#de.: &'a mut Deserializerrust-analyzer cargo serde_cbor_2 0.13.0 de/Deserializer#<R>, |
| 977 | lenrust-analyzer cargo serde_cbor_2 0.13.0 de/MapAccess#len.: &'a mut usize, |
| 978 | accept_namedrust-analyzer cargo serde_cbor_2 0.13.0 de/MapAccess#accept_named.: bool, |
| 979 | accept_packedrust-analyzer cargo serde_cbor_2 0.13.0 de/MapAccess#accept_packed.: bool, |
| 980 | } |
| 981 | |
| 982 | impl<'de, R> derust-analyzer cargo serde 1.0.144 de/::MapAccessrust-analyzer cargo serde 1.0.144 de/MapAccess#<'de> for MapAccessrust-analyzer cargo serde_cbor_2 0.13.0 de/MapAccess#<'_, R> |
| 983 | where |
| 984 | R: Readrust-analyzer cargo serde_cbor_2 0.13.0 read/Read#<'de>, |
| 985 | { |
| 986 | type Errorrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`MapAccess<'_, R>`][`MapAccess<'de>`]Error# = Errorrust-analyzer cargo serde_cbor_2 0.13.0 error/Error#; |
| 987 | |
| 988 | fn next_key_seedrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`MapAccess<'_, R>`][`MapAccess<'de>`]next_key_seed().<K>(&mut self, seed: K) -> Resultrust-analyzer cargo serde_cbor_2 0.13.0 error/Result#<Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<K::Valuerust-analyzer cargo serde 1.0.144 de/DeserializeSeed#Value#>> |
| 989 | where |
| 990 | K: derust-analyzer cargo serde 1.0.144 de/::DeserializeSeedrust-analyzer cargo serde 1.0.144 de/DeserializeSeed#<'de>, |
| 991 | { |
| 992 | if *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&mut T`][Deref]deref().self.lenrust-analyzer cargo serde_cbor_2 0.13.0 de/MapAccess#len. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]eq().0 { |
| 993 | return Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#); |
| 994 | } |
| 995 | *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&mut T`][Deref]deref().self.lenrust-analyzer cargo serde_cbor_2 0.13.0 de/MapAccess#len. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`SubAssign<Self>`]sub_assign().-=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`SubAssign<Self>`]sub_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`SubAssign<Self>`]sub_assign().1; |
| 996 | |
| 997 | match self.derust-analyzer cargo serde_cbor_2 0.13.0 de/MapAccess#de..peekrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]peek().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch(). { |
| 998 | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(_byte @ 0x00..=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeInclusive#0x1b) if !rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().self.accept_packedrust-analyzer cargo serde_cbor_2 0.13.0 de/MapAccess#accept_packed. => { |
| 999 | return Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(self.derust-analyzer cargo serde_cbor_2 0.13.0 de/MapAccess#de..errorrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]error().(ErrorCoderust-analyzer cargo serde_cbor_2 0.13.0 error/ErrorCode#::WrongStructFormatrust-analyzer cargo serde_cbor_2 0.13.0 error/ErrorCode#WrongStructFormat#)); |
| 1000 | } |
| 1001 | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(_byte @ 0x60..=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeInclusive#0x7f) if !rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().self.accept_namedrust-analyzer cargo serde_cbor_2 0.13.0 de/MapAccess#accept_named. => { |
| 1002 | return Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(self.derust-analyzer cargo serde_cbor_2 0.13.0 de/MapAccess#de..errorrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]error().(ErrorCoderust-analyzer cargo serde_cbor_2 0.13.0 error/ErrorCode#::WrongStructFormatrust-analyzer cargo serde_cbor_2 0.13.0 error/ErrorCode#WrongStructFormat#)); |
| 1003 | } |
| 1004 | _ => {} |
| 1005 | }; |
| 1006 | |
| 1007 | let value = seed.deserializerust-analyzer cargo serde 1.0.144 de/DeserializeSeed#deserialize().(&mut *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&mut T`][Deref]deref().self.derust-analyzer cargo serde_cbor_2 0.13.0 de/MapAccess#de.)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 1008 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(value)) |
| 1009 | } |
| 1010 | |
| 1011 | fn next_value_seedrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`MapAccess<'_, R>`][`MapAccess<'de>`]next_value_seed().<V>(&mut self, seed: V) -> Resultrust-analyzer cargo serde_cbor_2 0.13.0 error/Result#<V::Valuerust-analyzer cargo serde 1.0.144 de/DeserializeSeed#Value#> |
| 1012 | where |
| 1013 | V: derust-analyzer cargo serde 1.0.144 de/::DeserializeSeedrust-analyzer cargo serde 1.0.144 de/DeserializeSeed#<'de>, |
| 1014 | { |
| 1015 | seed.deserializerust-analyzer cargo serde 1.0.144 de/DeserializeSeed#deserialize().(&mut *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&mut T`][Deref]deref().self.derust-analyzer cargo serde_cbor_2 0.13.0 de/MapAccess#de.) |
| 1016 | } |
| 1017 | |
| 1018 | fn size_hintrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`MapAccess<'_, R>`][`MapAccess<'de>`]size_hint().(&self) -> Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<usize> { |
| 1019 | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&mut T`][Deref]deref().self.lenrust-analyzer cargo serde_cbor_2 0.13.0 de/MapAccess#len.) |
| 1020 | } |
| 1021 | } |
| 1022 | |
| 1023 | impl<'de, R> MakeErrorrust-analyzer cargo serde_cbor_2 0.13.0 de/MakeError# for MapAccessrust-analyzer cargo serde_cbor_2 0.13.0 de/MapAccess#<'_, R> |
| 1024 | where |
| 1025 | R: Readrust-analyzer cargo serde_cbor_2 0.13.0 read/Read#<'de>, |
| 1026 | { |
| 1027 | fn errorrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`MapAccess<'_, R>`][MakeError]error().(&self, code: ErrorCoderust-analyzer cargo serde_cbor_2 0.13.0 error/ErrorCode#) -> Errorrust-analyzer cargo serde_cbor_2 0.13.0 error/Error# { |
| 1028 | self.derust-analyzer cargo serde_cbor_2 0.13.0 de/MapAccess#de..errorrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]error().(code) |
| 1029 | } |
| 1030 | } |
| 1031 | |
| 1032 | struct IndefiniteMapAccessrust-analyzer cargo serde_cbor_2 0.13.0 de/IndefiniteMapAccess#<'a, R> { |
| 1033 | derust-analyzer cargo serde_cbor_2 0.13.0 de/IndefiniteMapAccess#de.: &'a mut Deserializerrust-analyzer cargo serde_cbor_2 0.13.0 de/Deserializer#<R>, |
| 1034 | accept_packedrust-analyzer cargo serde_cbor_2 0.13.0 de/IndefiniteMapAccess#accept_packed.: bool, |
| 1035 | accept_namedrust-analyzer cargo serde_cbor_2 0.13.0 de/IndefiniteMapAccess#accept_named.: bool, |
| 1036 | } |
| 1037 | |
| 1038 | impl<'de, R> derust-analyzer cargo serde 1.0.144 de/::MapAccessrust-analyzer cargo serde 1.0.144 de/MapAccess#<'de> for IndefiniteMapAccessrust-analyzer cargo serde_cbor_2 0.13.0 de/IndefiniteMapAccess#<'_, R> |
| 1039 | where |
| 1040 | R: Readrust-analyzer cargo serde_cbor_2 0.13.0 read/Read#<'de>, |
| 1041 | { |
| 1042 | type Errorrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`IndefiniteMapAccess<'_, R>`][`MapAccess<'de>`]Error# = Errorrust-analyzer cargo serde_cbor_2 0.13.0 error/Error#; |
| 1043 | |
| 1044 | fn next_key_seedrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`IndefiniteMapAccess<'_, R>`][`MapAccess<'de>`]next_key_seed().<K>(&mut self, seed: K) -> Resultrust-analyzer cargo serde_cbor_2 0.13.0 error/Result#<Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<K::Valuerust-analyzer cargo serde 1.0.144 de/DeserializeSeed#Value#>> |
| 1045 | where |
| 1046 | K: derust-analyzer cargo serde 1.0.144 de/::DeserializeSeedrust-analyzer cargo serde 1.0.144 de/DeserializeSeed#<'de>, |
| 1047 | { |
| 1048 | match self.derust-analyzer cargo serde_cbor_2 0.13.0 de/IndefiniteMapAccess#de..peekrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]peek().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch(). { |
| 1049 | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(_byte @ 0x00..=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeInclusive#0x1b) if !rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().self.accept_packedrust-analyzer cargo serde_cbor_2 0.13.0 de/IndefiniteMapAccess#accept_packed. => { |
| 1050 | return Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(self.derust-analyzer cargo serde_cbor_2 0.13.0 de/IndefiniteMapAccess#de..errorrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]error().(ErrorCoderust-analyzer cargo serde_cbor_2 0.13.0 error/ErrorCode#::WrongStructFormatrust-analyzer cargo serde_cbor_2 0.13.0 error/ErrorCode#WrongStructFormat#)) |
| 1051 | } |
| 1052 | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(_byte @ 0x60..=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeInclusive#0x7f) if !rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().self.accept_namedrust-analyzer cargo serde_cbor_2 0.13.0 de/IndefiniteMapAccess#accept_named. => { |
| 1053 | return Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(self.derust-analyzer cargo serde_cbor_2 0.13.0 de/IndefiniteMapAccess#de..errorrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]error().(ErrorCoderust-analyzer cargo serde_cbor_2 0.13.0 error/ErrorCode#::WrongStructFormatrust-analyzer cargo serde_cbor_2 0.13.0 error/ErrorCode#WrongStructFormat#)) |
| 1054 | } |
| 1055 | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(0xff) => return Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#), |
| 1056 | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(_) => {} |
| 1057 | Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None# => return Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(self.derust-analyzer cargo serde_cbor_2 0.13.0 de/IndefiniteMapAccess#de..errorrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]error().(ErrorCoderust-analyzer cargo serde_cbor_2 0.13.0 error/ErrorCode#::EofWhileParsingMaprust-analyzer cargo serde_cbor_2 0.13.0 error/ErrorCode#EofWhileParsingMap#)), |
| 1058 | } |
| 1059 | |
| 1060 | let value = seed.deserializerust-analyzer cargo serde 1.0.144 de/DeserializeSeed#deserialize().(&mut *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&mut T`][Deref]deref().self.derust-analyzer cargo serde_cbor_2 0.13.0 de/IndefiniteMapAccess#de.)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 1061 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(value)) |
| 1062 | } |
| 1063 | |
| 1064 | fn next_value_seedrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`IndefiniteMapAccess<'_, R>`][`MapAccess<'de>`]next_value_seed().<V>(&mut self, seed: V) -> Resultrust-analyzer cargo serde_cbor_2 0.13.0 error/Result#<V::Valuerust-analyzer cargo serde 1.0.144 de/DeserializeSeed#Value#> |
| 1065 | where |
| 1066 | V: derust-analyzer cargo serde 1.0.144 de/::DeserializeSeedrust-analyzer cargo serde 1.0.144 de/DeserializeSeed#<'de>, |
| 1067 | { |
| 1068 | seed.deserializerust-analyzer cargo serde 1.0.144 de/DeserializeSeed#deserialize().(&mut *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&mut T`][Deref]deref().self.derust-analyzer cargo serde_cbor_2 0.13.0 de/IndefiniteMapAccess#de.) |
| 1069 | } |
| 1070 | } |
| 1071 | |
| 1072 | struct UnitVariantAccessrust-analyzer cargo serde_cbor_2 0.13.0 de/UnitVariantAccess#<'a, R> { |
| 1073 | derust-analyzer cargo serde_cbor_2 0.13.0 de/UnitVariantAccess#de.: &'a mut Deserializerrust-analyzer cargo serde_cbor_2 0.13.0 de/Deserializer#<R>, |
| 1074 | } |
| 1075 | |
| 1076 | impl<'de, 'a, R> derust-analyzer cargo serde 1.0.144 de/::EnumAccessrust-analyzer cargo serde 1.0.144 de/EnumAccess#<'de> for UnitVariantAccessrust-analyzer cargo serde_cbor_2 0.13.0 de/UnitVariantAccess#<'a, R> |
| 1077 | where |
| 1078 | R: Readrust-analyzer cargo serde_cbor_2 0.13.0 read/Read#<'de>, |
| 1079 | { |
| 1080 | type Errorrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`UnitVariantAccess<'a, R>`][`EnumAccess<'de>`]Error# = Errorrust-analyzer cargo serde_cbor_2 0.13.0 error/Error#; |
| 1081 | type Variantrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`UnitVariantAccess<'a, R>`][`EnumAccess<'de>`]Variant# = UnitVariantAccessrust-analyzer cargo serde_cbor_2 0.13.0 de/UnitVariantAccess#<'a, R>; |
| 1082 | |
| 1083 | fn variant_seedrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`UnitVariantAccess<'a, R>`][`EnumAccess<'de>`]variant_seed().<V>(self, seed: V) -> Resultrust-analyzer cargo serde_cbor_2 0.13.0 error/Result#<(V::Valuerust-analyzer cargo serde 1.0.144 de/DeserializeSeed#Value#, UnitVariantAccessrust-analyzer cargo serde_cbor_2 0.13.0 de/UnitVariantAccess#<'a, R>)> |
| 1084 | where |
| 1085 | V: derust-analyzer cargo serde 1.0.144 de/::DeserializeSeedrust-analyzer cargo serde 1.0.144 de/DeserializeSeed#<'de>, |
| 1086 | { |
| 1087 | let variant = seed.deserializerust-analyzer cargo serde 1.0.144 de/DeserializeSeed#deserialize().(&mut *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&mut T`][Deref]deref().self.derust-analyzer cargo serde_cbor_2 0.13.0 de/UnitVariantAccess#de.)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 1088 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#((variant, self)) |
| 1089 | } |
| 1090 | } |
| 1091 | |
| 1092 | impl<'de, R> derust-analyzer cargo serde 1.0.144 de/::VariantAccessrust-analyzer cargo serde 1.0.144 de/VariantAccess#<'de> for UnitVariantAccessrust-analyzer cargo serde_cbor_2 0.13.0 de/UnitVariantAccess#<'_, R> |
| 1093 | where |
| 1094 | R: Readrust-analyzer cargo serde_cbor_2 0.13.0 read/Read#<'de>, |
| 1095 | { |
| 1096 | type Errorrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`UnitVariantAccess<'_, R>`][`VariantAccess<'de>`]Error# = Errorrust-analyzer cargo serde_cbor_2 0.13.0 error/Error#; |
| 1097 | |
| 1098 | fn unit_variantrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`UnitVariantAccess<'_, R>`][`VariantAccess<'de>`]unit_variant().(self) -> Resultrust-analyzer cargo serde_cbor_2 0.13.0 error/Result#<()> { |
| 1099 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(()) |
| 1100 | } |
| 1101 | |
| 1102 | fn newtype_variant_seedrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`UnitVariantAccess<'_, R>`][`VariantAccess<'de>`]newtype_variant_seed().<T>(self, _seed: T) -> Resultrust-analyzer cargo serde_cbor_2 0.13.0 error/Result#<T::Valuerust-analyzer cargo serde 1.0.144 de/DeserializeSeed#Value#> |
| 1103 | where |
| 1104 | T: derust-analyzer cargo serde 1.0.144 de/::DeserializeSeedrust-analyzer cargo serde 1.0.144 de/DeserializeSeed#<'de>, |
| 1105 | { |
| 1106 | Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(derust-analyzer cargo serde 1.0.144 de/::Errorrust-analyzer cargo serde 1.0.144 de/Error#::invalid_typerust-analyzer cargo serde_cbor_2 0.13.0 error/impl#[Error][Error]invalid_type().( |
| 1107 | derust-analyzer cargo serde 1.0.144 de/::Unexpectedrust-analyzer cargo serde 1.0.144 de/Unexpected#::UnitVariantrust-analyzer cargo serde 1.0.144 de/Unexpected#UnitVariant#, |
| 1108 | &"newtype variant", |
| 1109 | )) |
| 1110 | } |
| 1111 | |
| 1112 | fn tuple_variantrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`UnitVariantAccess<'_, R>`][`VariantAccess<'de>`]tuple_variant().<V>(self, _len: usize, _visitor: V) -> Resultrust-analyzer cargo serde_cbor_2 0.13.0 error/Result#<V::Valuerust-analyzer cargo serde 1.0.144 de/Visitor#Value#> |
| 1113 | where |
| 1114 | V: derust-analyzer cargo serde 1.0.144 de/::Visitorrust-analyzer cargo serde 1.0.144 de/Visitor#<'de>, |
| 1115 | { |
| 1116 | Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(derust-analyzer cargo serde 1.0.144 de/::Errorrust-analyzer cargo serde 1.0.144 de/Error#::invalid_typerust-analyzer cargo serde_cbor_2 0.13.0 error/impl#[Error][Error]invalid_type().( |
| 1117 | derust-analyzer cargo serde 1.0.144 de/::Unexpectedrust-analyzer cargo serde 1.0.144 de/Unexpected#::UnitVariantrust-analyzer cargo serde 1.0.144 de/Unexpected#UnitVariant#, |
| 1118 | &"tuple variant", |
| 1119 | )) |
| 1120 | } |
| 1121 | |
| 1122 | fn struct_variantrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`UnitVariantAccess<'_, R>`][`VariantAccess<'de>`]struct_variant().<V>(self, _fields: &'static [&'static str], _visitor: V) -> Resultrust-analyzer cargo serde_cbor_2 0.13.0 error/Result#<V::Valuerust-analyzer cargo serde 1.0.144 de/Visitor#Value#> |
| 1123 | where |
| 1124 | V: derust-analyzer cargo serde 1.0.144 de/::Visitorrust-analyzer cargo serde 1.0.144 de/Visitor#<'de>, |
| 1125 | { |
| 1126 | Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(derust-analyzer cargo serde 1.0.144 de/::Errorrust-analyzer cargo serde 1.0.144 de/Error#::invalid_typerust-analyzer cargo serde_cbor_2 0.13.0 error/impl#[Error][Error]invalid_type().( |
| 1127 | derust-analyzer cargo serde 1.0.144 de/::Unexpectedrust-analyzer cargo serde 1.0.144 de/Unexpected#::UnitVariantrust-analyzer cargo serde 1.0.144 de/Unexpected#UnitVariant#, |
| 1128 | &"struct variant", |
| 1129 | )) |
| 1130 | } |
| 1131 | } |
| 1132 | |
| 1133 | struct VariantAccessrust-analyzer cargo serde_cbor_2 0.13.0 de/VariantAccess#<T> { |
| 1134 | seqrust-analyzer cargo serde_cbor_2 0.13.0 de/VariantAccess#seq.: T, |
| 1135 | } |
| 1136 | |
| 1137 | impl<'de, T> derust-analyzer cargo serde 1.0.144 de/::EnumAccessrust-analyzer cargo serde 1.0.144 de/EnumAccess#<'de> for VariantAccessrust-analyzer cargo serde_cbor_2 0.13.0 de/VariantAccess#<T> |
| 1138 | where |
| 1139 | T: derust-analyzer cargo serde 1.0.144 de/::SeqAccessrust-analyzer cargo serde 1.0.144 de/SeqAccess#<'de, Errorrust-analyzer cargo serde 1.0.144 de/SeqAccess#Error# = Errorrust-analyzer cargo serde_cbor_2 0.13.0 error/Error#> + MakeErrorrust-analyzer cargo serde_cbor_2 0.13.0 de/MakeError#, |
| 1140 | { |
| 1141 | type Errorrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`VariantAccess<T>`][`EnumAccess<'de>`]Error# = Errorrust-analyzer cargo serde_cbor_2 0.13.0 error/Error#; |
| 1142 | type Variantrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`VariantAccess<T>`][`EnumAccess<'de>`]Variant# = VariantAccessrust-analyzer cargo serde_cbor_2 0.13.0 de/VariantAccess#<T>; |
| 1143 | |
| 1144 | fn variant_seedrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`VariantAccess<T>`][`EnumAccess<'de>`]variant_seed().<V>(mut self, seed: V) -> Resultrust-analyzer cargo serde_cbor_2 0.13.0 error/Result#<(V::Valuerust-analyzer cargo serde 1.0.144 de/DeserializeSeed#Value#, VariantAccessrust-analyzer cargo serde_cbor_2 0.13.0 de/VariantAccess#<T>)> |
| 1145 | where |
| 1146 | V: derust-analyzer cargo serde 1.0.144 de/::DeserializeSeedrust-analyzer cargo serde 1.0.144 de/DeserializeSeed#<'de>, |
| 1147 | { |
| 1148 | let variant = match self.seqrust-analyzer cargo serde_cbor_2 0.13.0 de/VariantAccess#seq..next_element_seedrust-analyzer cargo serde 1.0.144 de/SeqAccess#next_element_seed().(seed) { |
| 1149 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(variant)) => variant, |
| 1150 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#) => return Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(self.seqrust-analyzer cargo serde_cbor_2 0.13.0 de/VariantAccess#seq..errorrust-analyzer cargo serde_cbor_2 0.13.0 de/MakeError#error().(ErrorCoderust-analyzer cargo serde_cbor_2 0.13.0 error/ErrorCode#::ArrayTooShortrust-analyzer cargo serde_cbor_2 0.13.0 error/ErrorCode#ArrayTooShort#)), |
| 1151 | Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(e) => return Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(e), |
| 1152 | }; |
| 1153 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#((variant, self)) |
| 1154 | } |
| 1155 | } |
| 1156 | |
| 1157 | impl<'de, T> derust-analyzer cargo serde 1.0.144 de/::VariantAccessrust-analyzer cargo serde 1.0.144 de/VariantAccess#<'de> for VariantAccessrust-analyzer cargo serde_cbor_2 0.13.0 de/VariantAccess#<T> |
| 1158 | where |
| 1159 | T: derust-analyzer cargo serde 1.0.144 de/::SeqAccessrust-analyzer cargo serde 1.0.144 de/SeqAccess#<'de, Errorrust-analyzer cargo serde 1.0.144 de/SeqAccess#Error# = Errorrust-analyzer cargo serde_cbor_2 0.13.0 error/Error#> + MakeErrorrust-analyzer cargo serde_cbor_2 0.13.0 de/MakeError#, |
| 1160 | { |
| 1161 | type Errorrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`VariantAccess<T>`][`VariantAccess<'de>`]Error# = Errorrust-analyzer cargo serde_cbor_2 0.13.0 error/Error#; |
| 1162 | |
| 1163 | fn unit_variantrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`VariantAccess<T>`][`VariantAccess<'de>`]unit_variant().(mut self) -> Resultrust-analyzer cargo serde_cbor_2 0.13.0 error/Result#<()> { |
| 1164 | match self.seqrust-analyzer cargo serde_cbor_2 0.13.0 de/VariantAccess#seq..next_elementrust-analyzer cargo serde 1.0.144 de/SeqAccess#next_element().() { |
| 1165 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(())) => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(()), |
| 1166 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#) => Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(self.seqrust-analyzer cargo serde_cbor_2 0.13.0 de/VariantAccess#seq..errorrust-analyzer cargo serde_cbor_2 0.13.0 de/MakeError#error().(ErrorCoderust-analyzer cargo serde_cbor_2 0.13.0 error/ErrorCode#::ArrayTooLongrust-analyzer cargo serde_cbor_2 0.13.0 error/ErrorCode#ArrayTooLong#)), |
| 1167 | Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(e) => Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(e), |
| 1168 | } |
| 1169 | } |
| 1170 | |
| 1171 | fn newtype_variant_seedrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`VariantAccess<T>`][`VariantAccess<'de>`]newtype_variant_seed().<S>(mut self, seed: S) -> Resultrust-analyzer cargo serde_cbor_2 0.13.0 error/Result#<S::Valuerust-analyzer cargo serde 1.0.144 de/DeserializeSeed#Value#> |
| 1172 | where |
| 1173 | S: derust-analyzer cargo serde 1.0.144 de/::DeserializeSeedrust-analyzer cargo serde 1.0.144 de/DeserializeSeed#<'de>, |
| 1174 | { |
| 1175 | match self.seqrust-analyzer cargo serde_cbor_2 0.13.0 de/VariantAccess#seq..next_element_seedrust-analyzer cargo serde 1.0.144 de/SeqAccess#next_element_seed().(seed) { |
| 1176 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(variant)) => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(variant), |
| 1177 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#) => Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(self.seqrust-analyzer cargo serde_cbor_2 0.13.0 de/VariantAccess#seq..errorrust-analyzer cargo serde_cbor_2 0.13.0 de/MakeError#error().(ErrorCoderust-analyzer cargo serde_cbor_2 0.13.0 error/ErrorCode#::ArrayTooShortrust-analyzer cargo serde_cbor_2 0.13.0 error/ErrorCode#ArrayTooShort#)), |
| 1178 | Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(e) => Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(e), |
| 1179 | } |
| 1180 | } |
| 1181 | |
| 1182 | fn tuple_variantrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`VariantAccess<T>`][`VariantAccess<'de>`]tuple_variant().<V>(self, _len: usize, visitor: V) -> Resultrust-analyzer cargo serde_cbor_2 0.13.0 error/Result#<V::Valuerust-analyzer cargo serde 1.0.144 de/Visitor#Value#> |
| 1183 | where |
| 1184 | V: derust-analyzer cargo serde 1.0.144 de/::Visitorrust-analyzer cargo serde 1.0.144 de/Visitor#<'de>, |
| 1185 | { |
| 1186 | visitor.visit_seqrust-analyzer cargo serde 1.0.144 de/Visitor#visit_seq().(self.seqrust-analyzer cargo serde_cbor_2 0.13.0 de/VariantAccess#seq.) |
| 1187 | } |
| 1188 | |
| 1189 | fn struct_variantrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`VariantAccess<T>`][`VariantAccess<'de>`]struct_variant().<V>(mut self, _fields: &'static [&'static str], visitor: V) -> Resultrust-analyzer cargo serde_cbor_2 0.13.0 error/Result#<V::Valuerust-analyzer cargo serde 1.0.144 de/Visitor#Value#> |
| 1190 | where |
| 1191 | V: derust-analyzer cargo serde 1.0.144 de/::Visitorrust-analyzer cargo serde 1.0.144 de/Visitor#<'de>, |
| 1192 | { |
| 1193 | let seed = StructVariantSeedrust-analyzer cargo serde_cbor_2 0.13.0 de/StructVariantSeed# { visitorrust-analyzer cargo serde_cbor_2 0.13.0 de/StructVariantSeed#visitor. }; |
| 1194 | match self.seqrust-analyzer cargo serde_cbor_2 0.13.0 de/VariantAccess#seq..next_element_seedrust-analyzer cargo serde 1.0.144 de/SeqAccess#next_element_seed().(seed) { |
| 1195 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(variant)) => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(variant), |
| 1196 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#) => Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(self.seqrust-analyzer cargo serde_cbor_2 0.13.0 de/VariantAccess#seq..errorrust-analyzer cargo serde_cbor_2 0.13.0 de/MakeError#error().(ErrorCoderust-analyzer cargo serde_cbor_2 0.13.0 error/ErrorCode#::ArrayTooShortrust-analyzer cargo serde_cbor_2 0.13.0 error/ErrorCode#ArrayTooShort#)), |
| 1197 | Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(e) => Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(e), |
| 1198 | } |
| 1199 | } |
| 1200 | } |
| 1201 | |
| 1202 | struct StructVariantSeedrust-analyzer cargo serde_cbor_2 0.13.0 de/StructVariantSeed#<V> { |
| 1203 | visitorrust-analyzer cargo serde_cbor_2 0.13.0 de/StructVariantSeed#visitor.: V, |
| 1204 | } |
| 1205 | |
| 1206 | impl<'de, V> derust-analyzer cargo serde 1.0.144 de/::DeserializeSeedrust-analyzer cargo serde 1.0.144 de/DeserializeSeed#<'de> for StructVariantSeedrust-analyzer cargo serde_cbor_2 0.13.0 de/StructVariantSeed#<V> |
| 1207 | where |
| 1208 | V: derust-analyzer cargo serde 1.0.144 de/::Visitorrust-analyzer cargo serde 1.0.144 de/Visitor#<'de>, |
| 1209 | { |
| 1210 | type Valuerust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`StructVariantSeed<V>`][`DeserializeSeed<'de>`]Value# = V::Valuerust-analyzer cargo serde 1.0.144 de/Visitor#Value#; |
| 1211 | |
| 1212 | fn deserializerust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`StructVariantSeed<V>`][`DeserializeSeed<'de>`]deserialize().<D>(self, de: D) -> 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#<V::Valuerust-analyzer cargo serde 1.0.144 de/Visitor#Value#, D::Errorrust-analyzer cargo serde 1.0.144 de/Deserializer#Error#> |
| 1213 | where |
| 1214 | D: derust-analyzer cargo serde 1.0.144 de/::Deserializerrust-analyzer cargo serde 1.0.144 de/Deserializer#<'de>, |
| 1215 | { |
| 1216 | de.deserialize_anyrust-analyzer cargo serde 1.0.144 de/Deserializer#deserialize_any().(self.visitorrust-analyzer cargo serde_cbor_2 0.13.0 de/StructVariantSeed#visitor.) |
| 1217 | } |
| 1218 | } |
| 1219 | |
| 1220 | /// Iterator that deserializes a stream into multiple CBOR values. |
| 1221 | /// |
| 1222 | /// A stream deserializer can be created from any CBOR deserializer using the |
| 1223 | /// `Deserializer::into_iter` method. |
| 1224 | /// |
| 1225 | /// ``` |
| 1226 | /// use serde_cbor_2::de::Deserializer; |
| 1227 | /// use serde_cbor_2::value::Value; |
| 1228 | /// |
| 1229 | /// # fn main() { |
| 1230 | /// let data: Vec<u8> = vec![ |
| 1231 | /// 0x01, 0x66, 0x66, 0x6f, 0x6f, 0x62, 0x61, 0x72, |
| 1232 | /// ]; |
| 1233 | /// let mut it = Deserializer::from_slice(&data[..]).into_iter::<Value>(); |
| 1234 | /// assert_eq!( |
| 1235 | /// Value::Integer(1), |
| 1236 | /// it.next().unwrap().unwrap() |
| 1237 | /// ); |
| 1238 | /// assert_eq!( |
| 1239 | /// Value::Text("foobar".to_string()), |
| 1240 | /// it.next().unwrap().unwrap() |
| 1241 | /// ); |
| 1242 | /// # } |
| 1243 | /// ``` |
| 1244 | #[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:)] |
| 1245 | pub struct StreamDeserializerrust-analyzer cargo serde_cbor_2 0.13.0 de/StreamDeserializer#<'de, R, T> { |
| 1246 | derust-analyzer cargo serde_cbor_2 0.13.0 de/StreamDeserializer#de.: Deserializerrust-analyzer cargo serde_cbor_2 0.13.0 de/Deserializer#<R>, |
| 1247 | outputrust-analyzer cargo serde_cbor_2 0.13.0 de/StreamDeserializer#output.: PhantomDatarust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/PhantomData#<T>, |
| 1248 | lifetimerust-analyzer cargo serde_cbor_2 0.13.0 de/StreamDeserializer#lifetime.: PhantomDatarust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/PhantomData#<&'de ()>, |
| 1249 | } |
| 1250 | |
| 1251 | impl<'de, R, T> StreamDeserializerrust-analyzer cargo serde_cbor_2 0.13.0 de/StreamDeserializer#<'de, R, T> |
| 1252 | where |
| 1253 | R: Readrust-analyzer cargo serde_cbor_2 0.13.0 read/Read#<'de>, |
| 1254 | T: derust-analyzer cargo serde 1.0.144 de/::Deserializerust-analyzer cargo serde 1.0.144 de/Deserialize#<'de>, |
| 1255 | { |
| 1256 | /// Create a new CBOR stream deserializer from one of the possible |
| 1257 | /// serde_cbor_2 input sources. |
| 1258 | /// |
| 1259 | /// Typically it is more convenient to use one of these methods instead: |
| 1260 | /// |
| 1261 | /// * `Deserializer::from_slice(...).into_iter()` |
| 1262 | /// * `Deserializer::from_reader(...).into_iter()` |
| 1263 | pub fn newrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`StreamDeserializer<'de, R, T>`]new().(read: R) -> StreamDeserializerrust-analyzer cargo serde_cbor_2 0.13.0 de/StreamDeserializer#<'de, R, T> { |
| 1264 | StreamDeserializerrust-analyzer cargo serde_cbor_2 0.13.0 de/StreamDeserializer# { |
| 1265 | derust-analyzer cargo serde_cbor_2 0.13.0 de/StreamDeserializer#de.: Deserializerrust-analyzer cargo serde_cbor_2 0.13.0 de/Deserializer#::newrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]new().(read), |
| 1266 | outputrust-analyzer cargo serde_cbor_2 0.13.0 de/StreamDeserializer#output.: PhantomDatarust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/PhantomData#, |
| 1267 | lifetimerust-analyzer cargo serde_cbor_2 0.13.0 de/StreamDeserializer#lifetime.: PhantomDatarust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/PhantomData#, |
| 1268 | } |
| 1269 | } |
| 1270 | } |
| 1271 | |
| 1272 | impl<'de, R, T> StreamDeserializerrust-analyzer cargo serde_cbor_2 0.13.0 de/StreamDeserializer#<'de, R, T> |
| 1273 | where |
| 1274 | R: Offsetrust-analyzer cargo serde_cbor_2 0.13.0 read/Offset#, |
| 1275 | T: derust-analyzer cargo serde 1.0.144 de/::Deserializerust-analyzer cargo serde 1.0.144 de/Deserialize#<'de>, |
| 1276 | { |
| 1277 | /// Return the current offset in the reader |
| 1278 | #[inline] |
| 1279 | pub fn byte_offsetrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`StreamDeserializer<'de, R, T>`]byte_offset().(&self) -> usize { |
| 1280 | self.derust-analyzer cargo serde_cbor_2 0.13.0 de/StreamDeserializer#de..byte_offsetrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]byte_offset().() |
| 1281 | } |
| 1282 | } |
| 1283 | |
| 1284 | impl<'de, R, T> Iteratorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator# for StreamDeserializerrust-analyzer cargo serde_cbor_2 0.13.0 de/StreamDeserializer#<'de, R, T> |
| 1285 | where |
| 1286 | R: Readrust-analyzer cargo serde_cbor_2 0.13.0 read/Read#<'de>, |
| 1287 | T: derust-analyzer cargo serde 1.0.144 de/::Deserializerust-analyzer cargo serde 1.0.144 de/Deserialize#<'de>, |
| 1288 | { |
| 1289 | type Itemrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`StreamDeserializer<'de, R, T>`][Iterator]Item# = Resultrust-analyzer cargo serde_cbor_2 0.13.0 error/Result#<T>; |
| 1290 | |
| 1291 | fn nextrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`StreamDeserializer<'de, R, T>`][Iterator]next().(&mut self) -> Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Resultrust-analyzer cargo serde_cbor_2 0.13.0 error/Result#<T>> { |
| 1292 | match self.derust-analyzer cargo serde_cbor_2 0.13.0 de/StreamDeserializer#de..peekrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`Deserializer<R>`]peek().() { |
| 1293 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(_)) => Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(T::deserializerust-analyzer cargo serde 1.0.144 de/Deserialize#deserialize().(&mut self.derust-analyzer cargo serde_cbor_2 0.13.0 de/StreamDeserializer#de.)), |
| 1294 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#) => Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#, |
| 1295 | Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(e) => Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(e)), |
| 1296 | } |
| 1297 | } |
| 1298 | } |
| 1299 | |
| 1300 | struct VariantAccessMaprust-analyzer cargo serde_cbor_2 0.13.0 de/VariantAccessMap#<T> { |
| 1301 | maprust-analyzer cargo serde_cbor_2 0.13.0 de/VariantAccessMap#map.: T, |
| 1302 | } |
| 1303 | |
| 1304 | impl<'de, T> derust-analyzer cargo serde 1.0.144 de/::EnumAccessrust-analyzer cargo serde 1.0.144 de/EnumAccess#<'de> for VariantAccessMaprust-analyzer cargo serde_cbor_2 0.13.0 de/VariantAccessMap#<T> |
| 1305 | where |
| 1306 | T: derust-analyzer cargo serde 1.0.144 de/::MapAccessrust-analyzer cargo serde 1.0.144 de/MapAccess#<'de, Errorrust-analyzer cargo serde 1.0.144 de/MapAccess#Error# = Errorrust-analyzer cargo serde_cbor_2 0.13.0 error/Error#> + MakeErrorrust-analyzer cargo serde_cbor_2 0.13.0 de/MakeError#, |
| 1307 | { |
| 1308 | type Errorrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`VariantAccessMap<T>`][`EnumAccess<'de>`]Error# = Errorrust-analyzer cargo serde_cbor_2 0.13.0 error/Error#; |
| 1309 | type Variantrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`VariantAccessMap<T>`][`EnumAccess<'de>`]Variant# = VariantAccessMaprust-analyzer cargo serde_cbor_2 0.13.0 de/VariantAccessMap#<T>; |
| 1310 | |
| 1311 | fn variant_seedrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`VariantAccessMap<T>`][`EnumAccess<'de>`]variant_seed().<V>(mut self, seed: V) -> Resultrust-analyzer cargo serde_cbor_2 0.13.0 error/Result#<(V::Valuerust-analyzer cargo serde 1.0.144 de/DeserializeSeed#Value#, VariantAccessMaprust-analyzer cargo serde_cbor_2 0.13.0 de/VariantAccessMap#<T>)> |
| 1312 | where |
| 1313 | V: derust-analyzer cargo serde 1.0.144 de/::DeserializeSeedrust-analyzer cargo serde 1.0.144 de/DeserializeSeed#<'de>, |
| 1314 | { |
| 1315 | let variant = match self.maprust-analyzer cargo serde_cbor_2 0.13.0 de/VariantAccessMap#map..next_key_seedrust-analyzer cargo serde 1.0.144 de/MapAccess#next_key_seed().(seed) { |
| 1316 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(variant)) => variant, |
| 1317 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#) => return Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(self.maprust-analyzer cargo serde_cbor_2 0.13.0 de/VariantAccessMap#map..errorrust-analyzer cargo serde_cbor_2 0.13.0 de/MakeError#error().(ErrorCoderust-analyzer cargo serde_cbor_2 0.13.0 error/ErrorCode#::ArrayTooShortrust-analyzer cargo serde_cbor_2 0.13.0 error/ErrorCode#ArrayTooShort#)), |
| 1318 | Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(e) => return Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(e), |
| 1319 | }; |
| 1320 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#((variant, self)) |
| 1321 | } |
| 1322 | } |
| 1323 | |
| 1324 | impl<'de, T> derust-analyzer cargo serde 1.0.144 de/::VariantAccessrust-analyzer cargo serde 1.0.144 de/VariantAccess#<'de> for VariantAccessMaprust-analyzer cargo serde_cbor_2 0.13.0 de/VariantAccessMap#<T> |
| 1325 | where |
| 1326 | T: derust-analyzer cargo serde 1.0.144 de/::MapAccessrust-analyzer cargo serde 1.0.144 de/MapAccess#<'de, Errorrust-analyzer cargo serde 1.0.144 de/MapAccess#Error# = Errorrust-analyzer cargo serde_cbor_2 0.13.0 error/Error#> + MakeErrorrust-analyzer cargo serde_cbor_2 0.13.0 de/MakeError#, |
| 1327 | { |
| 1328 | type Errorrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`VariantAccessMap<T>`][`VariantAccess<'de>`]Error# = Errorrust-analyzer cargo serde_cbor_2 0.13.0 error/Error#; |
| 1329 | |
| 1330 | fn unit_variantrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`VariantAccessMap<T>`][`VariantAccess<'de>`]unit_variant().(mut self) -> Resultrust-analyzer cargo serde_cbor_2 0.13.0 error/Result#<()> { |
| 1331 | match self.maprust-analyzer cargo serde_cbor_2 0.13.0 de/VariantAccessMap#map..next_valuerust-analyzer cargo serde 1.0.144 de/MapAccess#next_value().() { |
| 1332 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(()) => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(()), |
| 1333 | Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(e) => Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(e), |
| 1334 | } |
| 1335 | } |
| 1336 | |
| 1337 | fn newtype_variant_seedrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`VariantAccessMap<T>`][`VariantAccess<'de>`]newtype_variant_seed().<S>(mut self, seed: S) -> Resultrust-analyzer cargo serde_cbor_2 0.13.0 error/Result#<S::Valuerust-analyzer cargo serde 1.0.144 de/DeserializeSeed#Value#> |
| 1338 | where |
| 1339 | S: derust-analyzer cargo serde 1.0.144 de/::DeserializeSeedrust-analyzer cargo serde 1.0.144 de/DeserializeSeed#<'de>, |
| 1340 | { |
| 1341 | self.maprust-analyzer cargo serde_cbor_2 0.13.0 de/VariantAccessMap#map..next_value_seedrust-analyzer cargo serde 1.0.144 de/MapAccess#next_value_seed().(seed) |
| 1342 | } |
| 1343 | |
| 1344 | fn tuple_variantrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`VariantAccessMap<T>`][`VariantAccess<'de>`]tuple_variant().<V>(mut self, _len: usize, visitor: V) -> Resultrust-analyzer cargo serde_cbor_2 0.13.0 error/Result#<V::Valuerust-analyzer cargo serde 1.0.144 de/Visitor#Value#> |
| 1345 | where |
| 1346 | V: derust-analyzer cargo serde 1.0.144 de/::Visitorrust-analyzer cargo serde 1.0.144 de/Visitor#<'de>, |
| 1347 | { |
| 1348 | let seed = StructVariantSeedrust-analyzer cargo serde_cbor_2 0.13.0 de/StructVariantSeed# { visitorrust-analyzer cargo serde_cbor_2 0.13.0 de/StructVariantSeed#visitor. }; |
| 1349 | self.maprust-analyzer cargo serde_cbor_2 0.13.0 de/VariantAccessMap#map..next_value_seedrust-analyzer cargo serde 1.0.144 de/MapAccess#next_value_seed().(seed) |
| 1350 | } |
| 1351 | |
| 1352 | fn struct_variantrust-analyzer cargo serde_cbor_2 0.13.0 de/impl#[`VariantAccessMap<T>`][`VariantAccess<'de>`]struct_variant().<V>(mut self, _fields: &'static [&'static str], visitor: V) -> Resultrust-analyzer cargo serde_cbor_2 0.13.0 error/Result#<V::Valuerust-analyzer cargo serde 1.0.144 de/Visitor#Value#> |
| 1353 | where |
| 1354 | V: derust-analyzer cargo serde 1.0.144 de/::Visitorrust-analyzer cargo serde 1.0.144 de/Visitor#<'de>, |
| 1355 | { |
| 1356 | let seed = StructVariantSeedrust-analyzer cargo serde_cbor_2 0.13.0 de/StructVariantSeed# { visitorrust-analyzer cargo serde_cbor_2 0.13.0 de/StructVariantSeed#visitor. }; |
| 1357 | self.maprust-analyzer cargo serde_cbor_2 0.13.0 de/VariantAccessMap#map..next_value_seedrust-analyzer cargo serde 1.0.144 de/MapAccess#next_value_seed().(seed) |
| 1358 | } |
| 1359 | } |