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>,
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)>,
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))
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)
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<'a> From<NibbleSlice<'a>> for NodeKey
impl<'a> From<NibbleSlice<'a>> for NodeKey
source§fn from(slice: NibbleSlice<'a>) -> NodeKey
fn from(slice: NibbleSlice<'a>) -> NodeKey
Converts to this type from the input type.