pub struct DagNode {
pub kind: SymbolKind,
pub meta: NodeMetadata,
pub children: ChildList,
}Expand description
A node in the global DAG.
Each DagNode represents a unique sub-expression. It contains:
- What kind of symbol it is (variable, constant, operator, function).
- Metadata (hash, coefficient, arity, flags).
- Children (references to other DAG nodes via
DagNodeId).
For constant nodes, the value is stored inline in kind as
SymbolKind::Constant(val) — no separate Option<f64> field.
Fields§
§kind: SymbolKindThe classification of this node.
meta: NodeMetadataAlgebraic metadata (hash, coefficient, flags).
children: ChildListReferences to child nodes in the arena.
Implementations§
Source§impl DagNode
impl DagNode
Sourcepub const fn variable(kind: SymbolKind, meta: NodeMetadata) -> Self
pub const fn variable(kind: SymbolKind, meta: NodeMetadata) -> Self
Creates a variable leaf node.
Sourcepub const fn constant(val: f64, meta: NodeMetadata) -> Self
pub const fn constant(val: f64, meta: NodeMetadata) -> Self
Creates a numeric constant leaf node.
Sourcepub const fn operator(
kind: SymbolKind,
meta: NodeMetadata,
children: ChildList,
) -> Self
pub const fn operator( kind: SymbolKind, meta: NodeMetadata, children: ChildList, ) -> Self
Creates an operator node with the given children.
Trait Implementations§
Source§impl<'__de, __Context> BorrowDecode<'__de, __Context> for DagNode
impl<'__de, __Context> BorrowDecode<'__de, __Context> for DagNode
Source§fn borrow_decode<__D: BorrowDecoder<'__de, Context = __Context>>(
decoder: &mut __D,
) -> Result<Self, DecodeError>
fn borrow_decode<__D: BorrowDecoder<'__de, Context = __Context>>( decoder: &mut __D, ) -> Result<Self, DecodeError>
Attempt to decode this type with the given [
BorrowDecode]. Read moreAuto Trait Implementations§
impl Freeze for DagNode
impl RefUnwindSafe for DagNode
impl Send for DagNode
impl Sync for DagNode
impl Unpin for DagNode
impl UnsafeUnpin for DagNode
impl UnwindSafe for DagNode
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more