pub struct StateGraph {
pub nodes: HashMap<String, DynNode>,
pub edges: Vec<Edge>,
pub conditional_edges: Vec<ConditionalEdge>,
pub entry_point: Option<String>,
}Expand description
StateGraph - fluent builder for creating DAGs
Fields§
§nodes: HashMap<String, DynNode>§edges: Vec<Edge>§conditional_edges: Vec<ConditionalEdge>§entry_point: Option<String>Implementations§
Source§impl StateGraph
impl StateGraph
Sourcepub fn add_node<F, Fut>(self, name: impl Into<String>, func: F) -> Self
pub fn add_node<F, Fut>(self, name: impl Into<String>, func: F) -> Self
Add a node with a function
Sourcepub fn add_node_impl(self, node: impl Node + 'static) -> Self
pub fn add_node_impl(self, node: impl Node + 'static) -> Self
Add a pre-built node
Sourcepub fn add_edge(self, from: impl Into<String>, to: impl Into<String>) -> Self
pub fn add_edge(self, from: impl Into<String>, to: impl Into<String>) -> Self
Add a direct edge between two nodes
Sourcepub fn add_edge_to_end(self, from: impl Into<String>) -> Self
pub fn add_edge_to_end(self, from: impl Into<String>) -> Self
Add an edge to END
Sourcepub fn add_conditional_edge<F>(self, from: impl Into<String>, router: F) -> Self
pub fn add_conditional_edge<F>(self, from: impl Into<String>, router: F) -> Self
Add a conditional edge with a router function
Sourcepub fn set_entry_point(self, name: impl Into<String>) -> Self
pub fn set_entry_point(self, name: impl Into<String>) -> Self
Set the entry point node
Sourcepub fn compile(self) -> Result<CompiledGraph>
pub fn compile(self) -> Result<CompiledGraph>
Compile the graph for execution
Trait Implementations§
Auto Trait Implementations§
impl Freeze for StateGraph
impl !RefUnwindSafe for StateGraph
impl Send for StateGraph
impl Sync for StateGraph
impl Unpin for StateGraph
impl UnsafeUnpin for StateGraph
impl !UnwindSafe for StateGraph
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