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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
//! Control running graph instance from the code.
//!
//! While most of the changes on the graph are driven through the UI, there may
//! be cases where one needs to control it from the underlying code: e.g.
//! reverting unwanted operations or populating output node widgets. `Request`
//! is intended for these operations.
//!
//! When [`run_with_callback`](../fn.run_with_callback.html) is used, list of
//! `Request`s should be returned from the callback:
//!
//! ```ignore
//! gazpatcho::run_with_callback("Application Name", config, |report| {
//! // ...
//! vec![
//! Request::SetValue { ... },
//! Request::RemovePatch { ... },
//! ...
//! ]
//! });
//! ```
//!
//! When [`run_with_mpsc`](../fn.run_with_mpsc.html) is used, `Request` should
//! be passed through a `mpsc` connected to the `request_rx`:
//!
//! ```ignore
//! // ...
//! let (request_tx, request_rx) = mpsc::channel::<Request>();
//!
//! thread::spawn(move || {
//! request_tx.send(Request::SetValue { ... }).unwrap();
//! request_tx.send(Request::RemovePatch { ... }).unwrap();
//! });
//!
//! gazpatcho::run_with_mpsc("Application Name", config, report_tx, request_rx);
//! ```
use crateaction;
use cratestate;
use crate;
/// Actions that can be requested on a running instance of the UI.
///
/// See the [module documentation](index.html) to learn more about usage of
/// `Request`.