struct TaggedAccessViaParent<'der, 'a, 'de> {
parent: &'der mut Deserializer<'a, 'de>,
remaining: usize,
}Expand description
Shared access adapter routing each yielded value through the parent
Deserializer. The msgpack length-prefixed header (array length for
sequences, map length for maps) is consumed up front in the
corresponding deserialize_* method before this adapter is built; from
there each element/key/value just reads its own bytes through the
parent, so any nested tagged values still see this wrapper’s
interception.
Used as SeqAccess (e.g. Vec<T>, &[T]) and MapAccess (e.g.
BTreeMap<K, V>). Once deserialize_tuple lands, fixed-length Rust
tuples will share the SeqAccess impl too. Mirror of the serializer’s
TaggedSerializeViaParent.
Fields§
§parent: &'der mut Deserializer<'a, 'de>§remaining: usizeTrait Implementations§
Source§impl<'de, 'der, 'a> MapAccess<'de> for TaggedAccessViaParent<'der, 'a, 'de>
Free-form maps. next_key_seed decrements remaining and deserializes
the key; next_value_seed deserializes the value without
decrementing (it pairs with the just-yielded key).
impl<'de, 'der, 'a> MapAccess<'de> for TaggedAccessViaParent<'der, 'a, 'de>
Free-form maps. next_key_seed decrements remaining and deserializes
the key; next_value_seed deserializes the value without
decrementing (it pairs with the just-yielded key).
Source§type Error = Error
type Error = Error
Source§fn next_key_seed<K>(&mut self, seed: K) -> Result<Option<K::Value>, Self::Error>where
K: DeserializeSeed<'de>,
fn next_key_seed<K>(&mut self, seed: K) -> Result<Option<K::Value>, Self::Error>where
K: DeserializeSeed<'de>,
Ok(Some(key)) for the next key in the map, or Ok(None)
if there are no more remaining entries. Read moreSource§fn next_value_seed<V>(&mut self, seed: V) -> Result<V::Value, Self::Error>where
V: DeserializeSeed<'de>,
fn next_value_seed<V>(&mut self, seed: V) -> Result<V::Value, Self::Error>where
V: DeserializeSeed<'de>,
Ok(value) for the next value in the map. Read moreSource§fn size_hint(&self) -> Option<usize>
fn size_hint(&self) -> Option<usize>
Source§fn next_entry_seed<K, V>(
&mut self,
kseed: K,
vseed: V,
) -> Result<Option<(<K as DeserializeSeed<'de>>::Value, <V as DeserializeSeed<'de>>::Value)>, Self::Error>where
K: DeserializeSeed<'de>,
V: DeserializeSeed<'de>,
fn next_entry_seed<K, V>(
&mut self,
kseed: K,
vseed: V,
) -> Result<Option<(<K as DeserializeSeed<'de>>::Value, <V as DeserializeSeed<'de>>::Value)>, Self::Error>where
K: DeserializeSeed<'de>,
V: DeserializeSeed<'de>,
Ok(Some((key, value))) for the next (key-value) pair in
the map, or Ok(None) if there are no more remaining items. Read moreSource§fn next_key<K>(&mut self) -> Result<Option<K>, Self::Error>where
K: Deserialize<'de>,
fn next_key<K>(&mut self) -> Result<Option<K>, Self::Error>where
K: Deserialize<'de>,
Ok(Some(key)) for the next key in the map, or Ok(None)
if there are no more remaining entries. Read moreSource§fn next_value<V>(&mut self) -> Result<V, Self::Error>where
V: Deserialize<'de>,
fn next_value<V>(&mut self) -> Result<V, Self::Error>where
V: Deserialize<'de>,
Ok(value) for the next value in the map. Read moreSource§fn next_entry<K, V>(&mut self) -> Result<Option<(K, V)>, Self::Error>where
K: Deserialize<'de>,
V: Deserialize<'de>,
fn next_entry<K, V>(&mut self) -> Result<Option<(K, V)>, Self::Error>where
K: Deserialize<'de>,
V: Deserialize<'de>,
Ok(Some((key, value))) for the next (key-value) pair in
the map, or Ok(None) if there are no more remaining items. Read moreSource§impl<'de, 'der, 'a> SeqAccess<'de> for TaggedAccessViaParent<'der, 'a, 'de>
Variable-length sequences and fixed-length tuples — both wire-encoded
as msgpack arrays. next_element_seed decrements remaining and
deserializes one element through the parent.
impl<'de, 'der, 'a> SeqAccess<'de> for TaggedAccessViaParent<'der, 'a, 'de>
Variable-length sequences and fixed-length tuples — both wire-encoded
as msgpack arrays. next_element_seed decrements remaining and
deserializes one element through the parent.
Source§type Error = Error
type Error = Error
Source§fn next_element_seed<T>(
&mut self,
seed: T,
) -> Result<Option<T::Value>, Self::Error>where
T: DeserializeSeed<'de>,
fn next_element_seed<T>(
&mut self,
seed: T,
) -> Result<Option<T::Value>, Self::Error>where
T: DeserializeSeed<'de>,
Ok(Some(value)) for the next value in the sequence, or
Ok(None) if there are no more remaining items. Read moreSource§fn size_hint(&self) -> Option<usize>
fn size_hint(&self) -> Option<usize>
Source§fn next_element<T>(&mut self) -> Result<Option<T>, Self::Error>where
T: Deserialize<'de>,
fn next_element<T>(&mut self) -> Result<Option<T>, Self::Error>where
T: Deserialize<'de>,
Ok(Some(value)) for the next value in the sequence, or
Ok(None) if there are no more remaining items. Read more