pub trait Node:
Debug
+ Send
+ Sync {
// Required methods
fn kind(&self) -> WorkflowNodeType;
fn id(&self) -> &str;
fn position(&self) -> usize;
fn run<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), NodeError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
// Provided methods
fn execute<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<Parameter>, NodeError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
fn create_msg<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Message> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
}Expand description
The Node trait is to be implemented by all node types that can occur in a workflow
The Node trait is designed to be used as a trait object which allow us to erase (type erasure) the concrete type and instead rely on the methods solely available through this trait.
Required Methods§
Sourcefn kind(&self) -> WorkflowNodeType
fn kind(&self) -> WorkflowNodeType
Return the type of node, this is used for easily locating the Start and End nodes
Provided Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".