pub struct SimpleGraph<State: GraphState> { /* private fields */ }Expand description
Simple graph using the old API (state-only nodes).
Implementations§
Source§impl<State: GraphState + 'static> SimpleGraph<State>
impl<State: GraphState + 'static> SimpleGraph<State>
Sourcepub fn add_node(
self,
name: impl Into<String>,
node: impl Node<State> + 'static,
) -> Self
pub fn add_node( self, name: impl Into<String>, node: impl Node<State> + 'static, ) -> Self
Add a node.
Sourcepub fn add_edge<F>(
self,
from: impl Into<String>,
to: impl Into<String>,
condition: F,
) -> Self
pub fn add_edge<F>( self, from: impl Into<String>, to: impl Into<String>, condition: F, ) -> Self
Add a conditional edge.
Sourcepub fn set_finish(self, names: &[&str]) -> Self
pub fn set_finish(self, names: &[&str]) -> Self
Set finish nodes.
Sourcepub fn build(self) -> GraphResult<Self>
pub fn build(self) -> GraphResult<Self>
Build the graph.
Sourcepub async fn run(&self, state: State) -> GraphResult<State>
pub async fn run(&self, state: State) -> GraphResult<State>
Run the graph.
Trait Implementations§
Source§impl<State: GraphState + 'static> Default for SimpleGraph<State>
impl<State: GraphState + 'static> Default for SimpleGraph<State>
Auto Trait Implementations§
impl<State> Freeze for SimpleGraph<State>
impl<State> !RefUnwindSafe for SimpleGraph<State>
impl<State> Send for SimpleGraph<State>
impl<State> Sync for SimpleGraph<State>
impl<State> Unpin for SimpleGraph<State>
impl<State> !UnwindSafe for SimpleGraph<State>
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