[][src]Trait canrun::state::IterResolved

pub trait IterResolved<'a, D: Domain<'a> + 'a> {
    fn iter_resolved(self) -> ResolvedStateIter<'a, D>;
}

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();
Loading content...

Implementations on Foreign Types

impl<'a, D: Domain<'a> + 'a> IterResolved<'a, D> for Option<State<'a, D>>[src]

Loading content...

Implementors

impl<'a, D: Domain<'a> + 'a> IterResolved<'a, D> for Goal<'a, D>[src]

impl<'a, D: Domain<'a> + 'a> IterResolved<'a, D> for State<'a, D>[src]

Loading content...