pub struct PathMapKey {
pub index: usize,
pub value: StaticValue,
}Expand description
A key of a serialized map entry.
Fields§
§index: usizeSequential index of the key in the map during serialization.
Note that this is the index as serde “sees” it. If you’re using unordered maps (e.g. a HashMap), this index will have little meaning and might actually point to different elements even if the data in the maps is the exactly the same, or for the same map in different application runs.
For ordered maps this index might be useful if your map keys are not trivially serializable, like, for example, tuples. In which case you won’t have the full key value captured, but would still be able to refer to a concrete map entry by its index.
value: StaticValueCaptured value of the map key.
For trivial values, like numbers, the actual value is captured here.
For non-trivial, compound values, only the metadata is captured.
For map keys of type Value::Bytes the actual bytes are not captured to avoid
allocation on every map key.
Trait Implementations§
Source§impl Clone for PathMapKey
impl Clone for PathMapKey
Source§fn clone(&self) -> PathMapKey
fn clone(&self) -> PathMapKey
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more