flarrow_api/
node.rs

1use tokio::task::JoinHandle;
2
3use crate::prelude::*;
4
5pub enum NodeResult {
6    Nothing,
7}
8
9pub trait Node: Send + Sync {
10    #[allow(clippy::new_ret_no_self)]
11    fn new(inputs: Inputs, outputs: Outputs, configuration: serde_yml::Value) -> NodeNewResult
12    where
13        Self: Sized;
14
15    fn start(self: Box<Self>) -> NodeStartResult;
16}
17
18pub type NodeNewResult = JoinHandle<eyre::Result<Box<dyn Node>>>;
19pub type NodeStartResult = JoinHandle<eyre::Result<()>>;
20
21pub type DynamicallyLinkedNodeInstance = fn(Inputs, Outputs, serde_yml::Value) -> NodeNewResult;