1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
use Arc;
use async_trait;
use crate::;
/// Node specific behavior
///
/// [`Action`] stores the specific execution logic of a task.
///
/// # Example
/// An implementation of [`Action`]: `HelloAction`, having private
/// fields `statement` and `repeat`.
///
/// ```rust
/// use std::sync::Arc;
/// use dagrs::{Action, EnvVar, Output, InChannels, OutChannels};
/// use async_trait::async_trait;
///
/// struct HelloAction{
/// statement: String,
/// repeat: usize,
/// }
///
/// #[async_trait]
/// impl Action for HelloAction{
/// async fn run(&self, _: &mut InChannels, _: &mut OutChannels, _: Arc<EnvVar>) -> Output{
/// for i in 0..self.repeat {
/// println!("{}",self.statement);
/// }
/// Output::empty()
/// }
/// }
///
/// let hello=HelloAction {
/// statement: "hello world!".to_string(),
/// repeat: 10
/// };
///
/// ```
/// An empty implementaion of [`Action`].
///
/// Used as a placeholder when creating a `Node` without `Action`.
;