pub struct FnNode<F>where
F: Fn(&AgentState, &GraphConfig) -> Pin<Box<dyn Future<Output = Result<NodeOutput>> + Send>> + Send + Sync,{ /* private fields */ }Expand description
Helper to create a node from an async function
Implementations§
Trait Implementations§
Source§impl<F> Node for FnNode<F>where
F: Fn(&AgentState, &GraphConfig) -> Pin<Box<dyn Future<Output = Result<NodeOutput>> + Send>> + Send + Sync,
impl<F> Node for FnNode<F>where
F: Fn(&AgentState, &GraphConfig) -> Pin<Box<dyn Future<Output = Result<NodeOutput>> + Send>> + Send + Sync,
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,
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
Auto Trait Implementations§
impl<F> Freeze for FnNode<F>where
F: Freeze,
impl<F> RefUnwindSafe for FnNode<F>where
F: RefUnwindSafe,
impl<F> Send for FnNode<F>
impl<F> Sync for FnNode<F>
impl<F> Unpin for FnNode<F>where
F: Unpin,
impl<F> UnsafeUnpin for FnNode<F>where
F: UnsafeUnpin,
impl<F> UnwindSafe for FnNode<F>where
F: UnwindSafe,
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