Type Alias trie_db::node::NodeKey

source ·
pub type NodeKey = (usize, SmallVec<[u8; 40]>);
Expand description

Partial node key type: offset and owned value of a nibbleslice. Offset is applied on first byte of array (bytes are right aligned).

Trait Implementations§

1.56.0 · source§

impl<A, B, ExtendA, ExtendB> Extend<(A, B)> for (ExtendA, ExtendB)where ExtendA: Extend<A>, ExtendB: Extend<B>,

source§

fn extend<T>(&mut self, into_iter: T)where T: IntoIterator<Item = (A, B)>,

Allows to extend a tuple of collections that also implement Extend.

See also: Iterator::unzip

Examples
let mut tuple = (vec![0], vec![1]);
tuple.extend([(2, 3), (4, 5), (6, 7)]);
assert_eq!(tuple.0, [0, 2, 4, 6]);
assert_eq!(tuple.1, [1, 3, 5, 7]);

// also allows for arbitrarily nested tuples as elements
let mut nested_tuple = (vec![1], (vec![2], vec![3]));
nested_tuple.extend([(4, (5, 6)), (7, (8, 9))]);

let (a, (b, c)) = nested_tuple;
assert_eq!(a, [1, 4, 7]);
assert_eq!(b, [2, 5, 8]);
assert_eq!(c, [3, 6, 9]);
source§

fn extend_one(&mut self, item: (A, B))

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
source§

impl From<&NibbleVec> for NodeKey

source§

fn from(nibble: &NibbleVec) -> NodeKey

Converts to this type from the input type.
1.71.0 · source§

impl<T> From<[T; 2]> for (T, T)

source§

fn from(array: [T; 2]) -> (T, T)

Converts to this type from the input type.
source§

impl<'a> From<NibbleSlice<'a>> for NodeKey

source§

fn from(slice: NibbleSlice<'a>) -> NodeKey

Converts to this type from the input type.