Enum adapton::reflect::trace::Effect
[−]
[src]
pub enum Effect { UserEffect(Cost, String), DebugLabel(Option<Name>, String), Alloc(AllocCase, AllocKind), Force(ForceCase), Dirty, CleanRec, CleanEdge, CleanEval, Remove, }
The effects of the DCG (including cleaning and dirtying) on one of its edges.
Variants
UserEffect(Cost, String)
Catch-all for user-defined (e.g., application-specific) effects, whose presence in the trace structure may aid debugging, visualization, analytic cost analysis, etc.
DebugLabel(Option<Name>, String)
Debugging/visualization information: An ID (the optional name) and string.
(Maybe this should be combined with UserEffect
someday?).
Alloc(AllocCase, AllocKind)
Wrapper for Effect::Alloc; transition to DCG after the alloc.
Force(ForceCase)
Wrapper for Effect::Force; transition to DCG after the force.
Dirty
Transition to this edge as dirty (potentially inconsistent). This transition may consist of marking other edges dirty. The DCG's invariant about dirty edges is simple: If an edge is dirty, then all edges that force (demand/observe) the source of that edge must also be dirty. This transitive closure property ensures that we do not accidentally reuse stale cached values by mistake (a dirty edge will always witness a potentially stale cached value).
CleanRec
Clean this edge, marking it not dirty, or equivalently,
definitely consistent. Cleaning an edge consists of
processing the edge's dirty transitive dependencies, if any.
Recursively, this processing may consist of marking other edges
clean (CleanEdge
), and/or, removing edges (Remove
) and
replacing them via reevaluation under the current DCG state
(CleanEval
).
This process finishes in one of two mutually-exclusive
situations: Either the edge is cleaned, meaning that its target
need not be recomputed (CleanEdge
). Or else, the value on this
edge has changed, and this means that the edge's source is
potentially affected by the change. Consequently, this change
requires that the edge source be reevaluated (CleanEval
).
CleanEdge
Transition to this edge as clean (definitely consistent),
after doing a recursive cleaning of its dependencies and finding
that they are clean. This effect is mutually-exclusive with
CleanEval
, which occurs when CleanEdge
cannot occur on
an edge that is being recursively cleaned (via CleanRec
).
CleanEval
Re-evaluate the previously-forced thunk that is the target of
this edge, to clean it. This effect is mutually-exclusive with
CleanEdge
. It occurs when CleanEdge
cannot occur.
Remove
Transition to the DCG without this edge. Perhaps it will be replaced via re-execution, sometime later.
Trait Implementations
impl Clone for Effect
[src]
fn clone(&self) -> Effect
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more