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
//! The communication interface among a `tosca` device and its controller.
//!
//! This crate provides APIs to:
//!
//! - Encode and decode information about a device structure and its routes.
//! A route is a path that allows a controller to start one or
//! more tasks on a device. Each route is always associated with a response.
//! - Manage hazards that may arise during the execution of a route.
//! Hazards describe safety, privacy, and financial risks, and are always
//! associated with a route.
//! - Manage route parameters. Parameters may represent external
//! information required for device tasks or conditions that control whether
//! instructions are executed. For example, a boolean parameter might control
//! the on/off state of a light, while a float range might adjust its
//! brightness state.
//!
//! Data exchange between the device and controller requires structures to be
//! serializable and deserializable. A device serializes these structures
//! while the controller deserializes them and uses the data for its tasks.
//! A device can avoid importing deserialization functions by disabling the
//! `deserialize` feature at compile time.
//!
//! This crate can be compiled for both `std` and `no_std` environments.
extern crate alloc;
/// Description of a device and its associated routes.
/// Economic information about a device.
/// Energy information about a device.
/// Event descriptions and methods.
/// Hazard descriptions and methods.
/// Route parameters.
/// All possible responses from a device.
/// Route definitions.
pub
pub