pub struct GraphBuilder<S: StateSchema> { /* private fields */ }Expand description
GraphBuilder - Fluent builder pattern for StateGraph
Implementations§
Source§impl<S: StateSchema + 'static> GraphBuilder<S>
impl<S: StateSchema + 'static> GraphBuilder<S>
pub fn new() -> Self
pub fn add_node<N: GraphNode<S> + 'static>(self, node: N) -> Self
pub fn add_node_fn<F>(self, name: impl Into<String>, func: F) -> Self
pub fn add_async_node<F>(self, name: impl Into<String>, func: F) -> Selfwhere
F: AsyncFn<S> + 'static,
pub fn add_subgraph<SubS: StateSchema + 'static>( self, name: impl Into<String>, subgraph: CompiledGraph<SubS>, input_mapper: impl Fn(&S) -> SubS + Send + Sync + 'static, output_mapper: impl Fn(&SubS, &mut S) + Send + Sync + 'static, ) -> Self
pub fn add_subgraph_same_state( self, name: impl Into<String>, subgraph: CompiledGraph<S>, ) -> Self
pub fn add_edge( self, source: impl Into<String>, target: impl Into<String>, ) -> Self
pub fn add_conditional_edges( self, source: impl Into<String>, router_name: impl Into<String>, targets: HashMap<String, String>, default: Option<String>, ) -> Self
pub fn add_fan_out( self, source: impl Into<String>, targets: Vec<String>, ) -> Self
pub fn add_fan_in(self, sources: Vec<String>, target: impl Into<String>) -> Self
pub fn set_entry_point(self, node: impl Into<String>) -> Self
pub fn compile(self) -> GraphResult<CompiledGraph<S>>
pub fn build(self) -> StateGraph<S>
Trait Implementations§
Source§impl<S: StateSchema + 'static> Default for GraphBuilder<S>
impl<S: StateSchema + 'static> Default for GraphBuilder<S>
Auto Trait Implementations§
impl<S> !RefUnwindSafe for GraphBuilder<S>
impl<S> !UnwindSafe for GraphBuilder<S>
impl<S> Freeze for GraphBuilder<S>
impl<S> Send for GraphBuilder<S>
impl<S> Sync for GraphBuilder<S>
impl<S> Unpin for GraphBuilder<S>
impl<S> UnsafeUnpin for GraphBuilder<S>
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