graph_builder/graph/
mod.rs1pub mod adj_list;
2pub mod csr;
3
4#[derive(Clone, Copy, Debug)]
6#[repr(C)]
7pub struct Target<NI, EV> {
8 pub target: NI,
9 pub value: EV,
10}
11
12impl<T: Ord, V> Ord for Target<T, V> {
13 fn cmp(&self, other: &Self) -> std::cmp::Ordering {
14 self.target.cmp(&other.target)
15 }
16}
17
18impl<T: PartialOrd, V> PartialOrd for Target<T, V> {
19 fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
20 self.target.partial_cmp(&other.target)
21 }
22}
23
24impl<T: PartialEq, V> PartialEq for Target<T, V> {
25 fn eq(&self, other: &Self) -> bool {
26 self.target.eq(&other.target)
27 }
28}
29
30impl<T: Eq, V> Eq for Target<T, V> {}
31
32impl<T, EV> Target<T, EV> {
33 pub fn new(target: T, value: EV) -> Self {
34 Self { target, value }
35 }
36}