flarrow-builtins 0.3.1

flarrow (flow + arrow) is a rust runtime/framework for building dataflow applications.
Documentation
use crate::prelude::*;

/// Simple operator that does nothing, it just passes its input to its output.
#[derive(Node)]
pub struct Transport {
    pub input: RawInput,
    pub output: RawOutput,
}

#[node(runtime = "default_runtime")]
impl Node for Transport {
    async fn new(
        mut inputs: Inputs,
        mut outputs: Outputs,
        _: Queries,
        _: Queryables,
        _: serde_yml::Value,
    ) -> Result<Self> {
        Ok(Self {
            input: inputs.raw("in").await?,
            output: outputs.raw("out").await?,
        })
    }

    async fn start(mut self: Box<Self>) -> Result<()> {
        while let Ok((_, data)) = self.input.recv().await {
            self.output.send(data).await?;
        }

        Ok(())
    }
}