pub struct SimpleGraph {
pub edges: HashMap<NodeId, Vec<NodeId>>,
pub labels: HashMap<NodeId, String>,
}Expand description
A lightweight directed-graph descriptor used by the evaluator layer.
This is a plain data structure — it does not own Node trait objects.
Use FilterGraph from crate::graph for full node execution.
Fields§
§edges: HashMap<NodeId, Vec<NodeId>>Adjacency list: source NodeId → list of successor NodeIds.
labels: HashMap<NodeId, String>Node labels for serialization and diagnostics.
Implementations§
Source§impl SimpleGraph
impl SimpleGraph
Sourcepub fn add_edge(&mut self, from: NodeId, to: NodeId)
pub fn add_edge(&mut self, from: NodeId, to: NodeId)
Add a directed edge (implicitly creates both nodes if absent).
Sourcepub fn node_count(&self) -> usize
pub fn node_count(&self) -> usize
Return the number of nodes.
Sourcepub fn edge_count(&self) -> usize
pub fn edge_count(&self) -> usize
Return the number of directed edges.
Trait Implementations§
Source§impl Clone for SimpleGraph
impl Clone for SimpleGraph
Source§fn clone(&self) -> SimpleGraph
fn clone(&self) -> SimpleGraph
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SimpleGraph
impl Debug for SimpleGraph
Source§impl Default for SimpleGraph
impl Default for SimpleGraph
Source§fn default() -> SimpleGraph
fn default() -> SimpleGraph
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for SimpleGraph
impl RefUnwindSafe for SimpleGraph
impl Send for SimpleGraph
impl Sync for SimpleGraph
impl Unpin for SimpleGraph
impl UnsafeUnpin for SimpleGraph
impl UnwindSafe for SimpleGraph
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more