use std::sync::Arc;
use crate::{PathTreeTypes, TreeNode};
#[derive(Debug, Clone)]
pub struct HalfEdge<T: PathTreeTypes> {
    pub path_segment: T::PathSegment,
    pub node_id: T::NodeId,
}
impl<T: PathTreeTypes> PartialEq for HalfEdge<T> {
    fn eq(&self, other: &Self) -> bool {
        let Self {
            path_segment,
            node_id,
        } = self;
        let Self {
            node_id: other_node_id,
            path_segment: other_path_segment,
        } = other;
        node_id.eq(other_node_id) && path_segment.eq(other_path_segment)
    }
}
impl<T: PathTreeTypes> Eq for HalfEdge<T>
where
    T::NodeId: Eq,
    T::PathSegment: Eq,
{
}
#[derive(Debug, Clone)]
pub struct HalfEdgeRef<'a, T: PathTreeTypes> {
    pub path_segment: &'a T::PathSegmentRef,
    pub node_id: T::NodeId,
}
impl<'a, T: PathTreeTypes> PartialEq for HalfEdgeRef<'a, T> {
    fn eq(&self, other: &Self) -> bool {
        let Self {
            path_segment,
            node_id,
        } = self;
        let Self {
            node_id: other_node_id,
            path_segment: other_path_segment,
        } = other;
        node_id.eq(other_node_id) && path_segment.eq(other_path_segment)
    }
}
impl<'a, T: PathTreeTypes> Eq for HalfEdgeRef<'a, T>
where
    T::NodeId: Eq,
    T::PathSegmentRef: Eq,
{
}
#[derive(Debug, Clone)]
pub struct HalfEdgeTreeNodeRef<'a, T: PathTreeTypes> {
    pub path_segment: &'a T::PathSegmentRef,
    pub node: &'a Arc<TreeNode<T>>,
}