Skip to main content

CanonicalBTreeMap

Type Alias CanonicalBTreeMap 

Source
pub type CanonicalBTreeMap<K, V> = BTreeMap<K, V>;
Expand description

A BTreeMap suitable for key position; an alias for BTreeMap itself.

In key position the canonical BCS encoding is exactly what is wanted — keys are ordered and compared by their serialized bytes — so no wrapper is needed. Use it for the key type of a MapView<Key, _>. In value position prefer NonCanonicalBTreeMap, which skips the per-save() canonical sort. This alias exists to make that intent explicit and to pair with NonCanonicalBTreeMap.

Aliased Type§

pub struct CanonicalBTreeMap<K, V> { /* private fields */ }