orx_tree/common_traits/
equality.rs

1use crate::{
2    Node, NodeMut, TreeVariant, memory::MemoryPolicy, node_ref::NodeRefCore,
3    pinned_storage::PinnedStorage,
4};
5
6impl<V, M, P> PartialEq for Node<'_, V, M, P>
7where
8    V: TreeVariant,
9    M: MemoryPolicy,
10    P: PinnedStorage,
11{
12    fn eq(&self, other: &Self) -> bool {
13        self.node_ptr() == other.node_ptr()
14    }
15}
16
17impl<'a, V, M, P> PartialEq<NodeMut<'a, V, M, P>> for Node<'_, V, M, P>
18where
19    V: TreeVariant,
20    M: MemoryPolicy,
21    P: PinnedStorage,
22{
23    fn eq(&self, other: &NodeMut<'a, V, M, P>) -> bool {
24        self.node_ptr() == other.node_ptr()
25    }
26}
27
28impl<V, M, P> PartialEq for NodeMut<'_, V, M, P>
29where
30    V: TreeVariant,
31    M: MemoryPolicy,
32    P: PinnedStorage,
33{
34    fn eq(&self, other: &Self) -> bool {
35        self.node_ptr() == other.node_ptr()
36    }
37}
38
39impl<'a, V, M, P> PartialEq<Node<'a, V, M, P>> for NodeMut<'_, V, M, P>
40where
41    V: TreeVariant,
42    M: MemoryPolicy,
43    P: PinnedStorage,
44{
45    fn eq(&self, other: &Node<'a, V, M, P>) -> bool {
46        self.node_ptr() == other.node_ptr()
47    }
48}