Skip to main content

GraphNode

Trait GraphNode 

Source
pub trait GraphNode<S>: Send + Sync
where S: GraphStateTrait,
{ // Required method fn run<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, state: &'life1 S, ctx: &'life2 mut NodeContext, ) -> Pin<Box<dyn Future<Output = Result<S::Update>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; }
Expand description

图节点抽象:给定当前状态与上下文,返回一个状态增量。

Required Methods§

Source

fn run<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, state: &'life1 S, ctx: &'life2 mut NodeContext, ) -> Pin<Box<dyn Future<Output = Result<S::Update>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Implementors§

Source§

impl<A, S> GraphNode<S> for AgentNode<A, S>
where A: Agent + 'static, S: GraphStateTrait, S::Update: Default,

Source§

impl<S, F> GraphNode<S> for FnNode<S, F>
where S: GraphStateTrait, F: Fn(&S, &mut NodeContext) -> S::Update + Send + Sync + 'static,