#[derive(Debug, Clone)]
pub struct NodeInfo {
pub layer: crate::graph::layer::Layer,
pub role: crate::graph::role::Role,
pub type_name: &'static str,
pub module_path: &'static str,
}
impl NodeInfo {
pub fn new(
layer: crate::graph::layer::Layer,
role: crate::graph::role::Role,
type_name: &'static str,
module_path: &'static str,
) -> Self {
Self {
layer,
role,
type_name,
module_path,
}
}
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_node_info_creation() {
let info = NodeInfo::new(
crate::graph::layer::Layer::Domain,
crate::graph::role::Role::Entity,
"TestType",
"test::module",
);
assert_eq!(info.type_name, "TestType");
assert_eq!(info.module_path, "test::module");
}
}