diff --git a/src/lib.rs b/src/lib.rs index fa3e909..602a254 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -162,6 +162,14 @@ impl std::ops::Index<&ClassId> for EGraph { } } +#[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))] +#[derive(Debug, Default, Clone, Hash, PartialEq, Eq, PartialOrd, Ord)] +pub struct NodeData { + // + #[cfg_attr(feature = "serde", serde(default))] + pub subsumed: bool, +} + #[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))] #[derive(Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)] pub struct Node { @@ -171,6 +179,9 @@ pub struct Node { pub eclass: ClassId, #[cfg_attr(feature = "serde", serde(default = "one"))] pub cost: Cost, + // Optional data about the node + #[cfg_attr(feature = "serde", serde(default))] + pub data: NodeData, } impl Node {