[][src]Trait mini_kanren::core::goal::Goal

pub trait Goal<T: Default>: Clone {
    pub fn apply(&self, s: T) -> Stream<T>;

    pub fn run(&self, n: usize) -> Stream<T> { ... }
pub fn run_inf(&self) -> Stream<T> { ... }
pub fn iter(&self) -> StreamIter<T>

Notable traits for StreamIter<T>

impl<T> Iterator for StreamIter<T> type Item = T;
{ ... } }

The Goal trait. See module-level documentation for more details.

Required methods

pub fn apply(&self, s: T) -> Stream<T>[src]

Apply the goal to a Substitution.

Loading content...

Provided methods

pub fn run(&self, n: usize) -> Stream<T>[src]

Run the goal by applying it to an Substitution. Returns at most n values.

pub fn run_inf(&self) -> Stream<T>[src]

Run the goal by applying it to an Substitution. Returns all values but may crash.

pub fn iter(&self) -> StreamIter<T>

Notable traits for StreamIter<T>

impl<T> Iterator for StreamIter<T> type Item = T;
[src]

Convert the goal into an iterator of values.

Loading content...

Implementors

impl<T: Default, G: Clone + Fn(T) -> Stream<T>> Goal<T> for G[src]

Loading content...