pub trait TaskNode:
Send
+ Sync
+ DynClone
+ Any {
type Input: NodeArg;
type Output: NodeArg;
type Error: Error + Send + Sync + 'static;
// Required method
fn evaluate<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
node_id: &'life1 DynNodeId<Self>,
input: &'life2 Self::Input,
) -> Pin<Box<dyn Future<Output = Result<Self::Output, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
}Expand description
A typed step in a Task.
Implement this trait for your own domain-specific nodes when you want full control over how a
task step runs. For lightweight closure nodes, use
Task::register_node_fn, or
Task::register_node_async_fn for async closures.
Required Associated Types§
Required Methods§
Sourcefn evaluate<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
node_id: &'life1 DynNodeId<Self>,
input: &'life2 Self::Input,
) -> Pin<Box<dyn Future<Output = Result<Self::Output, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn evaluate<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
node_id: &'life1 DynNodeId<Self>,
input: &'life2 Self::Input,
) -> Pin<Box<dyn Future<Output = Result<Self::Output, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Evaluates the node with the current input.
Trait Implementations§
Source§impl<Input: NodeArg, Output: NodeArg, Error: Error + Send + Sync + 'static> TaskNode for Box<dyn TaskNode<Input = Input, Output = Output, Error = Error>>
impl<Input: NodeArg, Output: NodeArg, Error: Error + Send + Sync + 'static> TaskNode for Box<dyn TaskNode<Input = Input, Output = Output, Error = Error>>
Source§fn evaluate<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
node_id: &'life1 NodeId<dyn TaskNode<Input = Self::Input, Output = Self::Output, Error = Self::Error>>,
input: &'life2 Self::Input,
) -> Pin<Box<dyn Future<Output = Result<Self::Output, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn evaluate<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
node_id: &'life1 NodeId<dyn TaskNode<Input = Self::Input, Output = Self::Output, Error = Self::Error>>,
input: &'life2 Self::Input,
) -> Pin<Box<dyn Future<Output = Result<Self::Output, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Evaluates the node with the current input.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".