peace_rt_model_core/
state_stored_and_discovered.rs

1use type_reg::untagged::BoxDtDisplay;
2
3/// Stored and/or discovered state for an item.
4#[derive(Clone, Debug)]
5pub enum StateStoredAndDiscovered {
6    /// Stored state exists, but the actual item state cannot be discovered.
7    ///
8    /// These can probably be ignored during `CleanCmd`, for idempotence even if
9    /// a previous clean up did not complete successfully and stored states
10    /// were not updated.
11    OnlyStoredExists {
12        /// Stored current state or stored goal state.
13        state_stored: BoxDtDisplay,
14    },
15    /// No state was stored, but the actual item state exists.
16    ///
17    /// These can probably be ignored during `EnsureCmd`, for idempotence even
18    /// if a previous ensure did not complete successfully and stored states
19    /// were not updated.
20    OnlyDiscoveredExists {
21        /// Discovered current state or stored goal state during execution.
22        state_discovered: BoxDtDisplay,
23    },
24    /// Both stored state and discovered state exist.
25    ///
26    /// This variant is the one that users likely should be warned when ensuring
27    /// changes.
28    ValuesDiffer {
29        /// Stored current state or stored goal state.
30        state_stored: BoxDtDisplay,
31        /// Discovered current state or stored goal state during execution.
32        state_discovered: BoxDtDisplay,
33    },
34}