pub struct StepGraph {
pub num_nodes: usize,
pub edges: Vec<(usize, usize)>,
pub nstate: Vec<StepState>,
}Expand description
Predecessor-governed step-graph owner.
Fields§
§num_nodes: usizeNumber of execution nodes.
edges: Vec<(usize, usize)>Directed predecessor edges.
nstate: Vec<StepState>Lifecycle state by node index.
Implementations§
Source§impl StepGraph
impl StepGraph
Sourcepub fn new(num_nodes: usize, edges: Vec<(usize, usize)>) -> StepGraph
pub fn new(num_nodes: usize, edges: Vec<(usize, usize)>) -> StepGraph
Construct initial readiness states for a valid edge set.
Sourcepub fn become_ready(&mut self, node: usize) -> bool
pub fn become_ready(&mut self, node: usize) -> bool
Promote a node after every predecessor completes.
Sourcepub fn start_running(&mut self, node: usize) -> bool
pub fn start_running(&mut self, node: usize) -> bool
Start one ready node.
Sourcepub fn complete_node(&mut self, node: usize) -> bool
pub fn complete_node(&mut self, node: usize) -> bool
Complete one running node.
Sourcepub fn done_stuttering(&mut self) -> bool
pub fn done_stuttering(&mut self) -> bool
Execute the terminal stutter when every node is complete.
Auto Trait Implementations§
impl Freeze for StepGraph
impl RefUnwindSafe for StepGraph
impl Send for StepGraph
impl Sync for StepGraph
impl Unpin for StepGraph
impl UnsafeUnpin for StepGraph
impl UnwindSafe for StepGraph
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