pub struct DecisionExplanation<'a> { /* private fields */ }Expand description
A read-only snapshot of one proposed update, borrowing only the graph.
Stores constant-size metadata and lazily explains at most
MAX_DECISION_EDGES edges, without allocating. Later updates of the source
state do not change this snapshot. See DecisionState::explain for usage.
Implementations§
Source§impl DecisionExplanation<'_>
impl DecisionExplanation<'_>
Sourcepub fn elapsed(&self) -> f64
pub fn elapsed(&self) -> f64
Elapsed time used to evaluate guards, including the proposed delta and the 3600-second cap, before any transition resets the timer.
Sourcepub fn selected_edge(&self) -> Option<usize>
pub fn selected_edge(&self) -> Option<usize>
Index of the first matching edge, including a wildcard hold.
None means no edge matches; see DecisionState::explain.
Sourcepub fn change(&self) -> Option<DecisionChange>
pub fn change(&self) -> Option<DecisionChange>
The change DecisionState::update would return for these inputs.
None covers both a hold and no match; inspect Self::selected_edge
to distinguish them. No state or elapsed time is changed.
Sourcepub fn edges(&self) -> impl ExactSizeIterator + DoubleEndedIterator
pub fn edges(&self) -> impl ExactSizeIterator + DoubleEndedIterator
Explain every edge in authored order without allocating. Lower-priority
guards are evaluated against the same pre-transition state and time;
a matching loser is DecisionEdgeOutcome::Shadowed, a failing edge is
DecisionEdgeOutcome::Rejected. See DecisionState::explain.
Trait Implementations§
Source§impl<'a> Clone for DecisionExplanation<'a>
impl<'a> Clone for DecisionExplanation<'a>
Source§fn clone(&self) -> DecisionExplanation<'a>
fn clone(&self) -> DecisionExplanation<'a>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more