[−][src]Trait canrun::state::IterResolved
Iterate over ResolvedStates
.
This trait is implemented on the typical values that contain or represent an
open state, such as Goal
and of course
State
itself.
Required methods
fn iter_resolved(self) -> ResolvedStateIter<'a, D>
Get an iterator of all valid, resolved states that can be derived.
Typically used indirectly through the
Query
interface.
This will iterate through all pending forks, discarding any that fail. Any unsatisfied constraints will also cause a potential resolved state to fail.
Example:
use canrun::{State, ResolvedState, IterResolved, val, var}; use canrun::example::I32; let x = var(); let state = State::new() .unify(&val!(x), &val!(1)); let results: Vec<ResolvedState<I32>> = state.iter_resolved().collect();