flow_impl 0.8.0

Definition of an Implementation trait for flow functions, and a derive macro
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use std::panic::{RefUnwindSafe, UnwindSafe};

use serde_json::Value;

pub type RunAgain = bool;
pub const RUN_AGAIN: RunAgain = true;
pub const DONT_RUN_AGAIN: RunAgain = false;

pub trait Implementation : RefUnwindSafe + UnwindSafe + Sync + Send {
    // An implementation can be run, with an array of inputs and returns a value (or null) and a
    // bool indicating if it should be ran again
    fn run(&self, inputs: Vec<Vec<Value>>) -> (Option<Value>, RunAgain);
}