use std::path::PathBuf;
#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct GraphNodeId(String);
impl GraphNodeId {
pub fn new(value: impl Into<String>) -> Self {
Self(value.into())
}
pub fn as_str(&self) -> &str {
&self.0
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub enum GraphNodeKind {
File,
Directory,
Package,
Workspace,
ExternalDependency,
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct GraphNode {
pub id: GraphNodeId,
pub kind: GraphNodeKind,
pub label: String,
pub path: Option<PathBuf>,
}