@@ -72,8 +72,8 @@ let processor = rack.processor();
72
72
``` rust,ignore
73
73
use logicline::{action, Rack};
74
74
75
- let mut state = Rack::new().with_recording_enabled();
76
- let mut processor = state .processor();
75
+ let mut rack = Rack::new().with_recording_enabled();
76
+ let mut processor = rack .processor();
77
77
78
78
// Some fan state
79
79
let mut fan = false;
@@ -98,13 +98,13 @@ processor
98
98
Some(())
99
99
}));
100
100
101
- state .ingress(&mut processor);
101
+ rack .ingress(&mut processor);
102
102
```
103
103
104
- When recorded, the state can be printed in a human-readable format:
104
+ When recorded, the rack state can be printed in a human-readable format:
105
105
106
106
``` rust,ignore
107
- println!("{}", state );
107
+ println!("{}", rack );
108
108
```
109
109
110
110
``` ignore
@@ -115,7 +115,7 @@ fan_on: temp_high(31.0) -> fan_on
115
115
Or serialized, e.g. to JSON for web visualization:
116
116
117
117
``` rust,ignore
118
- let serialized = serde_json::to_string_pretty(&state ).unwrap();
118
+ let serialized = serde_json::to_string_pretty(&rack ).unwrap();
119
119
```
120
120
121
121
``` json
@@ -260,11 +260,16 @@ automatically sorted by their names.
260
260
261
261
## Performance
262
262
263
- When the recording is disabled (either feature or the runtime state/processor
263
+ When recording is disabled (either feature or the runtime state/processor
264
264
flag), the logic lines bring almost no overhead in comparison to the
265
265
traditional combinators, such as similar methods of [ ` std::option::Option ` ] and
266
266
[ ` std::result::Result ` ] .
267
267
268
+ When recording is enabled, it is recommended to clone rack instances before
269
+ processing them in case if the instances are under Mutex or RwLock. This can be
270
+ performed either with [ ` Rack::clone ` ] with [ ` Rack::snapshot ` ] methods. The
271
+ second variant returns a [ ` Snapshot ` ] instance which contains line states only.
272
+
268
273
## Data visualization
269
274
270
275
The crate ` exporter ` feature provides a built-in exporter (HTTP server) for
0 commit comments