Skip to main content

Node

Trait Node 

Source
pub trait Node: Send + Sync {
    // Required method
    fn execute<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        state: &'life1 AgentState,
        config: &'life2 GraphConfig,
    ) -> Pin<Box<dyn Future<Output = Result<NodeOutput>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;

    // Provided method
    fn name(&self) -> Option<&str> { ... }
}
Expand description

A node in the agent graph. Nodes perform actions and can modify the shared state.

Required Methods§

Source

fn execute<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, state: &'life1 AgentState, config: &'life2 GraphConfig, ) -> Pin<Box<dyn Future<Output = Result<NodeOutput>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Execute this node

Provided Methods§

Source

fn name(&self) -> Option<&str>

Optional: Get a name for this node (for debugging)

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§