use crate::Array;
use std::cmp::Ordering;
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[non_exhaustive]
pub struct TreeRef<const N: usize> {
pub key: Array<N>,
pub location: Array<N>,
pub node_count: u64,
pub count: u32,
}
impl<const N: usize> TreeRef<N> {
#[inline]
#[must_use]
pub const fn new(key: Array<N>, location: Array<N>, node_count: u64, count: u32) -> Self {
Self {
key,
location,
node_count,
count,
}
}
}
impl<const N: usize> PartialOrd for TreeRef<N> {
#[inline]
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
self.key.partial_cmp(&other.key)
}
}
impl<const N: usize> Ord for TreeRef<N> {
#[inline]
fn cmp(&self, other_ref: &Self) -> Ordering {
self.key.cmp(&other_ref.key)
}
}