pub struct GraphExecutor {
pub max_steps: usize,
}Expand description
Graph 执行器 — 可配置运行时参数。
Fields§
§max_steps: usize全局运行时步数限制。 1 Step = 1 Node Entry。
Implementations§
Source§impl GraphExecutor
impl GraphExecutor
pub fn new(max_steps: usize) -> Self
Sourcepub async fn execute(
&self,
graph: Arc<Graph>,
initial_state: State,
) -> Result<GraphResult, GraphError>
pub async fn execute( &self, graph: Arc<Graph>, initial_state: State, ) -> Result<GraphResult, GraphError>
执行 Graph(阻塞模式)。
Blocking is derived from stream. 内部消费 stream 直到结束。
接收 Arc<Graph> 以避免克隆。与 execute_stream() 共享所有权模型。
⚠️ BarrierNode 不支持阻塞模式。 如果图中包含 BarrierNode,
会提前返回错误,引导用户使用 execute_stream()。
Sourcepub fn execute_stream(
&self,
graph: Arc<Graph>,
initial_state: State,
) -> GraphExecution
pub fn execute_stream( &self, graph: Arc<Graph>, initial_state: State, ) -> GraphExecution
流式执行 Graph,返回 GraphExecution(stream + handle)。
Stream is primary, Blocking is derived.
Trait Implementations§
Source§impl Clone for GraphExecutor
impl Clone for GraphExecutor
Source§fn clone(&self) -> GraphExecutor
fn clone(&self) -> GraphExecutor
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for GraphExecutor
impl Debug for GraphExecutor
Auto Trait Implementations§
impl Freeze for GraphExecutor
impl RefUnwindSafe for GraphExecutor
impl Send for GraphExecutor
impl Sync for GraphExecutor
impl Unpin for GraphExecutor
impl UnsafeUnpin for GraphExecutor
impl UnwindSafe for GraphExecutor
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