pub struct Graph {
pub inputs: Vec<u16>,
pub nodes: Vec<Node>,
pub outputs: Vec<u16>,
}Expand description
The complete TØR-G graph (DAG).
A graph consists of:
- Input declarations (external boolean values)
- Node definitions (boolean operations on sources)
- Output declarations (which node IDs are graph outputs)
The graph is guaranteed to be a DAG because nodes can only reference previously-defined IDs.
Fields§
§inputs: Vec<u16>Declared input IDs (in declaration order).
nodes: Vec<Node>Node definitions (in topological order).
outputs: Vec<u16>Output IDs (in declaration order).
Implementations§
Source§impl Graph
impl Graph
Sourcepub fn node_count(&self) -> usize
pub fn node_count(&self) -> usize
Number of nodes (excluding inputs).
Sourcepub fn input_count(&self) -> usize
pub fn input_count(&self) -> usize
Number of declared inputs.
Sourcepub fn output_count(&self) -> usize
pub fn output_count(&self) -> usize
Number of declared outputs.
Trait Implementations§
impl Eq for Graph
impl StructuralPartialEq for Graph
Auto Trait Implementations§
impl Freeze for Graph
impl RefUnwindSafe for Graph
impl Send for Graph
impl Sync for Graph
impl Unpin for Graph
impl UnwindSafe for Graph
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