Skip to main content

Resolver

Trait Resolver 

Source
pub trait Resolver {
    type Choice: Debug;

    // Required methods
    fn resolve(
        &mut self,
        goal_id: TermId,
        goal_term: AppTerm,
        context: &mut ResolveContext<'_>,
    ) -> Option<Resolved<Self::Choice>>;
    fn resume(
        &mut self,
        choice: &mut Self::Choice,
        goal_id: TermId,
        context: &mut ResolveContext<'_>,
    ) -> bool;
}
Expand description

The resolver is responsible for solving goals, e.g. through unification of variables or decomposing them into smaller goals.

Required Associated Types§

Required Methods§

Source

fn resolve( &mut self, goal_id: TermId, goal_term: AppTerm, context: &mut ResolveContext<'_>, ) -> Option<Resolved<Self::Choice>>

Source

fn resume( &mut self, choice: &mut Self::Choice, goal_id: TermId, context: &mut ResolveContext<'_>, ) -> bool

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<R: Resolver> Resolver for &mut R

Source§

type Choice = <R as Resolver>::Choice

Source§

fn resolve( &mut self, goal_id: TermId, goal_term: AppTerm, context: &mut ResolveContext<'_>, ) -> Option<Resolved<Self::Choice>>

Source§

fn resume( &mut self, choice: &mut Self::Choice, goal_id: TermId, context: &mut ResolveContext<'_>, ) -> bool

Implementors§

Source§

impl Resolver for ArithmeticResolver

Source§

impl<'a> Resolver for RuleResolver<'a>

Source§

impl<R1: Resolver, R2: Resolver> Resolver for OrElse<R1, R2>

Source§

type Choice = OrElseChoice<<R1 as Resolver>::Choice, <R2 as Resolver>::Choice>