pub struct CompiledSubgraph<S: WorkflowState> {
pub projector: Arc<dyn StateProjector<S>>,
pub max_steps: usize,
}Expand description
Fields§
§projector: Arc<dyn StateProjector<S>>类型擦除的执行器
max_steps: usize最大执行步数
Implementations§
Source§impl<S: WorkflowState> CompiledSubgraph<S>
impl<S: WorkflowState> CompiledSubgraph<S>
Sourcepub fn new(projector: Arc<dyn StateProjector<S>>, max_steps: usize) -> Self
pub fn new(projector: Arc<dyn StateProjector<S>>, max_steps: usize) -> Self
创建新的 CompiledSubgraph。
Sourcepub async fn execute(
&self,
outer: &mut S,
stream: Option<Arc<dyn StreamSink>>,
cancel: CancellationToken,
) -> Result<(), GraphError>
pub async fn execute( &self, outer: &mut S, stream: Option<Arc<dyn StreamSink>>, cancel: CancellationToken, ) -> Result<(), GraphError>
执行 Subgraph。
Sourcepub fn graph_name(&self) -> &str
pub fn graph_name(&self) -> &str
内层 Graph 的名称。
Sourcepub fn node_count(&self) -> usize
pub fn node_count(&self) -> usize
内层 Graph 的节点数。
Trait Implementations§
Source§impl<S: Clone + WorkflowState> Clone for CompiledSubgraph<S>
impl<S: Clone + WorkflowState> Clone for CompiledSubgraph<S>
Source§fn clone(&self) -> CompiledSubgraph<S>
fn clone(&self) -> CompiledSubgraph<S>
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 moreAuto Trait Implementations§
impl<S> !RefUnwindSafe for CompiledSubgraph<S>
impl<S> !UnwindSafe for CompiledSubgraph<S>
impl<S> Freeze for CompiledSubgraph<S>
impl<S> Send for CompiledSubgraph<S>
impl<S> Sync for CompiledSubgraph<S>
impl<S> Unpin for CompiledSubgraph<S>
impl<S> UnsafeUnpin for CompiledSubgraph<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