flarrow_runtime_core/
node.rs

1use crate::prelude::{thirdparty::libloading::Library, *};
2
3pub struct DynamicallyLinkedNode {
4    pub handle: Box<dyn Node>,
5    pub _library: Library,
6}
7
8pub enum RuntimeNode {
9    StaticallyLinked(Box<dyn Node>),
10    DynamicallyLinked(DynamicallyLinkedNode),
11}
12
13impl RuntimeNode {
14    /// This function will async wait the node termination (either success or error)
15    pub async fn run(self) -> Result<()> {
16        match self {
17            RuntimeNode::StaticallyLinked(node) => node.start().await?,
18            RuntimeNode::DynamicallyLinked(node) => node.handle.start().await?,
19        }
20    }
21}