use crate::utils::types::VertexIdx;
use core::fmt;
#[derive(PartialEq, Eq, Copy, Clone, Debug)]
pub enum VertexNode {
Casual(VertexIdx),
Conceptual,
Deleted,
}
impl VertexNode {
pub const fn idx(&self) -> Option<VertexIdx> {
match self {
VertexNode::Casual(idx) => Some(*idx),
_ => None,
}
}
pub const fn is_conceptual(&self) -> bool {
matches!(self, VertexNode::Conceptual)
}
pub const fn is_deleted(&self) -> bool {
matches!(self, VertexNode::Deleted)
}
}
impl fmt::Display for VertexNode {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
VertexNode::Casual(v_idx) => write!(f, "Casual({v_idx})"),
VertexNode::Conceptual => write!(f, "Conceptual"),
VertexNode::Deleted => write!(f, "Deleted"),
}
}
}