dataflow_rs/engine/
task.rs1use serde::Deserialize;
2use serde_json::Value;
3
4#[derive(Deserialize, Clone, Debug)]
5pub struct Task {
6 pub id: String,
7 pub name: String,
8 pub description: Option<String>,
9 pub condition: Option<Value>,
10 pub function: Function,
11}
12
13impl Task {
14 pub fn new(
15 id: String,
16 name: String,
17 description: Option<String>,
18 condition: Option<Value>,
19 function: Function,
20 ) -> Self {
21 Self {
22 id,
23 name,
24 description,
25 condition,
26 function,
27 }
28 }
29}
30
31#[derive(Deserialize, Clone, Debug)]
32pub struct Function {
33 pub name: String,
34 pub input: Value,
35}