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
//! `ResourceValues` — named-fields carrier for the three resource_gauge values.
/// Named-fields carrier for the three resource-gauge values (`actual`, `request`,
/// `limit`).
///
/// Replaces the previous positional `(f64, f64, f64)` triple on the constructor
/// and accessor surface — struct-literal construction (`ResourceValues { actual,
/// request, limit }`) and named destructuring (`let ResourceValues { actual,
/// request, limit } = state.values();`) both eliminate the "silently transpose
/// `request` and `limit`" hazard.
///
/// # Example
///
/// ```rust
/// use envision::component::ResourceValues;
///
/// let vals = ResourceValues {
/// actual: 250.0,
/// request: 500.0,
/// limit: 1000.0,
/// };
/// assert_eq!(vals.actual, 250.0);
/// assert_eq!(vals.request, 500.0);
/// assert_eq!(vals.limit, 1000.0);
/// ```