Struct cw_storage_plus::MultiIndex [−][src]
pub struct MultiIndex<'a, K, T> { /* fields omitted */ }
Expand description
MultiIndex stores (namespace, index_name, idx_value, pk) -> b“pk_len“. Allows many values per index, and references pk. The associated primary key value is stored in the main (pk_namespace) map, which stores (namespace, pk_namespace, pk) -> value.
The stored pk_len is used to recover the pk from the index namespace, and perform the secondary load of the associated value from the main map.
The MultiIndex definition must include a field for the pk. That is, the MultiIndex K value is always a n-tuple (n >= 2) and its last element must be the pk. The index function must therefore put the pk as last element, when generating the index.