1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
use crate::traits::Array;
use std::cmp::Ordering;
#[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd)]
pub struct TreeRef<ArrayType>
where
ArrayType: Array,
{
pub key: ArrayType,
pub location: ArrayType,
pub node_count: u64,
pub count: u32,
}
impl<ArrayType> TreeRef<ArrayType>
where
ArrayType: Array,
{
#[inline]
pub fn new(key: ArrayType, location: ArrayType, node_count: u64, count: u32) -> Self {
Self {
key,
location,
node_count,
count,
}
}
}
impl<ArrayType> Ord for TreeRef<ArrayType>
where
ArrayType: Array,
{
#[inline]
fn cmp(&self, other_ref: &Self) -> Ordering {
self.key.cmp(&other_ref.key)
}
}