pub struct GraphBuilder { /* private fields */ }Expand description
Builder for creating graphs
Implementations§
Source§impl GraphBuilder
impl GraphBuilder
Sourcepub fn add_node<F, Fut>(self, id: impl Into<String>, func: F) -> Selfwhere
F: Fn(GraphState) -> Fut + Send + Sync + 'static,
Fut: Future<Output = Result<GraphState, CrewError>> + Send + 'static,
pub fn add_node<F, Fut>(self, id: impl Into<String>, func: F) -> Selfwhere
F: Fn(GraphState) -> Fut + Send + Sync + 'static,
Fut: Future<Output = Result<GraphState, CrewError>> + Send + 'static,
Add a node with an async function
Sourcepub fn add_node_executor(
self,
id: impl Into<String>,
executor: Arc<dyn NodeFn>,
) -> Self
pub fn add_node_executor( self, id: impl Into<String>, executor: Arc<dyn NodeFn>, ) -> Self
Add a node with a custom executor
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_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 routing function
Sourcepub fn add_conditional_edge_router(
self,
from: impl Into<String>,
router: ConditionRouter,
) -> Self
pub fn add_conditional_edge_router( self, from: impl Into<String>, router: ConditionRouter, ) -> Self
Add a conditional edge with a ConditionRouter
Sourcepub fn max_iterations(self, max: u32) -> Self
pub fn max_iterations(self, max: u32) -> Self
Set maximum iterations
Sourcepub fn with_checkpointing(self, store: Arc<dyn CheckpointStore>) -> Self
pub fn with_checkpointing(self, store: Arc<dyn CheckpointStore>) -> Self
Enable checkpointing
Sourcepub fn checkpoint_interval(self, interval: u32) -> Self
pub fn checkpoint_interval(self, interval: u32) -> Self
Set checkpoint interval
Sourcepub fn node_timeout_ms(self, timeout: u64) -> Self
pub fn node_timeout_ms(self, timeout: u64) -> Self
Set node timeout
Trait Implementations§
Source§impl GraphBuilderSubgraphExt for GraphBuilder
impl GraphBuilderSubgraphExt for GraphBuilder
Source§fn add_subgraph(
self,
id: impl Into<String>,
graph: Graph,
mapping: StateMapping,
) -> Self
fn add_subgraph( self, id: impl Into<String>, graph: Graph, mapping: StateMapping, ) -> Self
Add a subgraph as a node
Source§fn add_parallel_subgraphs(
self,
id: impl Into<String>,
parallel: ParallelSubgraphs,
) -> Self
fn add_parallel_subgraphs( self, id: impl Into<String>, parallel: ParallelSubgraphs, ) -> Self
Add a parallel subgraphs node
Source§fn add_conditional_subgraph(
self,
id: impl Into<String>,
conditional: ConditionalSubgraph,
) -> Self
fn add_conditional_subgraph( self, id: impl Into<String>, conditional: ConditionalSubgraph, ) -> Self
Add a conditional subgraph node
Source§fn add_loop_subgraph(self, id: impl Into<String>, loop_sg: LoopSubgraph) -> Self
fn add_loop_subgraph(self, id: impl Into<String>, loop_sg: LoopSubgraph) -> Self
Add a loop subgraph node
Source§fn add_retry_subgraph(self, id: impl Into<String>, retry: RetrySubgraph) -> Self
fn add_retry_subgraph(self, id: impl Into<String>, retry: RetrySubgraph) -> Self
Add a retry subgraph node
Auto Trait Implementations§
impl Freeze for GraphBuilder
impl !RefUnwindSafe for GraphBuilder
impl Send for GraphBuilder
impl Sync for GraphBuilder
impl Unpin for GraphBuilder
impl UnsafeUnpin for GraphBuilder
impl !UnwindSafe for GraphBuilder
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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