struct ArrayProductMapAccess<'der, 'a, 'de> {
parent: &'der mut Deserializer<'a, 'de>,
product: Product,
layout: SmallVec<[(u8, bool); 8]>,
wire_remaining: usize,
next_position: usize,
}Expand description
MapAccess adapter for named structs decoded from the Array
strategy wire shape (positional fixarray of values). Unlike
TaggedProductMapAccess the wire carries no tags; we synthesize the
keys yielded to the visitor by walking the merged (active + reserved)
wire layout — see merged_wire_layout for why the merge is needed.
The visitor still receives (field_name, value) pairs — that’s how
serde-derive’s Deserialize for named structs is driven — but the
field-name source is the registry, not the wire.
Reserved slots inside the layout are drained transparently: the wire
position is consumed (so the outer stream stays aligned), but no
(field_name, value) pair is yielded to the visitor.
Short wires (wire_remaining < active count) yield Ok(None) once
exhausted; serde-derive’s #[serde(default)] machinery fills in any
missing trailing positions, same fallback as the Tagged path.
Long wires (wire_remaining > layout.len()) only reach this adapter
when allow_unknown_tags is set — the cap check at the call site
bails on the strict default. Extras past the layout get consumed-and-
discarded inside next_key_seed’s loop before reporting exhaustion.
Fields§
§parent: &'der mut Deserializer<'a, 'de>§product: Product§layout: SmallVec<[(u8, bool); 8]>Merged (active + reserved) wire layout, tag-ascending. Drives the per-position dispatch between “yield to visitor” (active) and “drain silently” (reserved).
wire_remaining: usizeWire entries left to consume.
next_position: usizeNext position in the merged layout to consider.
Trait Implementations§
Source§impl<'de, 'der, 'a> MapAccess<'de> for ArrayProductMapAccess<'der, 'a, 'de>
impl<'de, 'der, 'a> MapAccess<'de> for ArrayProductMapAccess<'der, 'a, 'de>
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 more