1use std::sync::Arc;
5
6use crate::{PathTreeTypes, TreeNode};
7
8#[derive(Debug, Clone)]
12pub struct HalfEdgeOwned<T: PathTreeTypes> {
13 pub path_segment: T::PathSegmentOwned,
15
16 pub node_id: T::NodeId,
18}
19
20impl<T: PathTreeTypes> PartialEq for HalfEdgeOwned<T> {
21 fn eq(&self, other: &Self) -> bool {
22 let Self {
23 path_segment,
24 node_id,
25 } = self;
26 let Self {
27 node_id: other_node_id,
28 path_segment: other_path_segment,
29 } = other;
30 node_id.eq(other_node_id) && path_segment.eq(other_path_segment)
31 }
32}
33
34impl<T: PathTreeTypes> Eq for HalfEdgeOwned<T>
35where
36 T::NodeId: Eq,
37 T::PathSegmentOwned: Eq,
38{
39}
40
41#[derive(Debug, Clone)]
45pub struct HalfEdge<'a, T: PathTreeTypes> {
46 pub path_segment: &'a T::PathSegment,
48
49 pub node_id: T::NodeId,
51}
52
53impl<'a, T: PathTreeTypes> PartialEq for HalfEdge<'a, T> {
54 fn eq(&self, other: &Self) -> bool {
55 let Self {
56 path_segment,
57 node_id,
58 } = self;
59 let Self {
60 node_id: other_node_id,
61 path_segment: other_path_segment,
62 } = other;
63 node_id.eq(other_node_id) && path_segment.eq(other_path_segment)
64 }
65}
66
67impl<'a, T: PathTreeTypes> Eq for HalfEdge<'a, T>
68where
69 T::NodeId: Eq,
70 T::PathSegment: Eq,
71{
72}
73
74#[derive(Debug, Clone)]
78pub struct HalfEdgeTreeNode<'a, T: PathTreeTypes> {
79 pub path_segment: &'a T::PathSegment,
81
82 pub node: &'a Arc<TreeNode<T>>,
84}