pub struct TaskNode<S: WorkflowState = State> {
pub name: String,
pub func: TaskFn<S>,
}Expand description
自定义逻辑节点。
Fields§
§name: String§func: TaskFn<S>Implementations§
Source§impl<S: WorkflowState> TaskNode<S>
impl<S: WorkflowState> TaskNode<S>
Trait Implementations§
Source§impl<S: WorkflowState> FlowNode<S> for TaskNode<S>
TaskNode 实现 FlowNode(向后兼容 — 使用 NodeContext)。
impl<S: WorkflowState> FlowNode<S> for TaskNode<S>
TaskNode 实现 FlowNode(向后兼容 — 使用 NodeContext)。
未来将迁移到 LeafNode + LeafContext。
Source§fn execute<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
ctx: &'life1 mut NodeContext<'life2, S>,
) -> Pin<Box<dyn Future<Output = Result<(), GraphError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn execute<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
ctx: &'life1 mut NodeContext<'life2, S>,
) -> Pin<Box<dyn Future<Output = Result<(), GraphError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
👎Deprecated since 0.6.0:
Use LeafNode (read-only state + mutations) or ExecutorOperation (composite control) instead.
执行节点逻辑。
Auto Trait Implementations§
impl<S = State> !RefUnwindSafe for TaskNode<S>
impl<S = State> !UnwindSafe for TaskNode<S>
impl<S> Freeze for TaskNode<S>
impl<S> Send for TaskNode<S>
impl<S> Sync for TaskNode<S>
impl<S> Unpin for TaskNode<S>
impl<S> UnsafeUnpin for TaskNode<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