Trait chalk_engine::context::AnswerStream
source · pub trait AnswerStream<I: Interner> {
// Required methods
fn peek_answer(
&mut self,
should_continue: impl Fn() -> bool,
) -> AnswerResult<I>;
fn next_answer(
&mut self,
should_continue: impl Fn() -> bool,
) -> AnswerResult<I>;
fn any_future_answer(&self, test: impl Fn(&Substitution<I>) -> bool) -> bool;
}
Required Methods§
sourcefn peek_answer(&mut self, should_continue: impl Fn() -> bool) -> AnswerResult<I>
fn peek_answer(&mut self, should_continue: impl Fn() -> bool) -> AnswerResult<I>
Gets the next answer for a given goal, but doesn’t increment the answer index.
Calling this or next_answer
again will give the same answer.
sourcefn next_answer(&mut self, should_continue: impl Fn() -> bool) -> AnswerResult<I>
fn next_answer(&mut self, should_continue: impl Fn() -> bool) -> AnswerResult<I>
Gets the next answer for a given goal, incrementing the answer index.
Calling this or peek_answer
again will give the next answer.
sourcefn any_future_answer(&self, test: impl Fn(&Substitution<I>) -> bool) -> bool
fn any_future_answer(&self, test: impl Fn(&Substitution<I>) -> bool) -> bool
Invokes test
with each possible future answer, returning true immediately
if we find any answer for which test
returns true.
Object Safety§
This trait is not object safe.