pub trait BoxedNode<Input, Output, Error, Context> {
// Required methods
fn run_boxed<'life0, 'life1, 'async_trait>(
&'life0 mut self,
input: Input,
context: &'life1 mut Context,
) -> Pin<Box<dyn Future<Output = Result<Output, Error>> + Send + 'async_trait>>
where Input: 'async_trait,
Output: 'async_trait,
Error: 'async_trait,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn describe(&self) -> Description;
}Available on crate feature
boxed_node only.Expand description
The BoxedNode trait is a dyn compatible wrapper around the Node trait.
BoxedNode trait provides the same functions as the Node trait
with the addition of dyn compatibility.
This allows you to use Box<dyn BoxedNode<...>>.
Blanket implementation of BoxedNode is implemented
for all types that implement Node trait.
See also Node.
§Examples
use node_flow::node::BoxedNode;
async fn run_node(
node: &mut dyn BoxedNode<String, String, String, ()>,
) {
let result = node.run_boxed("hello".into(), &mut ()).await;
println!("{:?}", result);
}Required Methods§
Sourcefn run_boxed<'life0, 'life1, 'async_trait>(
&'life0 mut self,
input: Input,
context: &'life1 mut Context,
) -> Pin<Box<dyn Future<Output = Result<Output, Error>> + Send + 'async_trait>>where
Input: 'async_trait,
Output: 'async_trait,
Error: 'async_trait,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn run_boxed<'life0, 'life1, 'async_trait>(
&'life0 mut self,
input: Input,
context: &'life1 mut Context,
) -> Pin<Box<dyn Future<Output = Result<Output, Error>> + Send + 'async_trait>>where
Input: 'async_trait,
Output: 'async_trait,
Error: 'async_trait,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Sourcefn describe(&self) -> Description
fn describe(&self) -> Description
Describes this node, its type signature and other specifics.
See Description for more details.
See also Node::describe.