Struct tfdeploy::analyser::rules::prelude::GivenAllRule [−][src]
pub struct GivenAllRule<'rules, T: Fact> { pub items: Vec<Exp<T>>, pub closure: Box<Fn(&mut Solver<'rules>, Vec<T::Concrete>) + 'rules>, }
The given rule.
It allows you to add more rules to the solver once the value of a given
expression is known, using a closure that takes the value as parameter.
It can be added to the solver via the following method:
solver.given(input.rank, |solver, ir|
// Add more rules to `solver` here.
);
Fields
items: Vec<Exp<T>>
closure: Box<Fn(&mut Solver<'rules>, Vec<T::Concrete>) + 'rules>
Methods
impl<'rules, T: Output + Fact> GivenAllRule<'rules, T>[src]
impl<'rules, T: Output + Fact> GivenAllRule<'rules, T>pub fn new<F>(items: Vec<Exp<T>>, closure: F) -> GivenAllRule<'rules, T> where
F: Fn(&mut Solver<'rules>, Vec<T::Concrete>) + 'rules, [src]
pub fn new<F>(items: Vec<Exp<T>>, closure: F) -> GivenAllRule<'rules, T> where
F: Fn(&mut Solver<'rules>, Vec<T::Concrete>) + 'rules, Creates a new GivenRule instance.
Trait Implementations
impl<'rules, T: Output + Fact> Rule<'rules> for GivenAllRule<'rules, T>[src]
impl<'rules, T: Output + Fact> Rule<'rules> for GivenAllRule<'rules, T>fn apply(
&self,
context: &mut Context
) -> Result<(bool, Vec<Box<Rule<'rules> + 'rules>>)>[src]
fn apply(
&self,
context: &mut Context
) -> Result<(bool, Vec<Box<Rule<'rules> + 'rules>>)>Tries to apply the rule to a given context.
fn get_paths(&self) -> Vec<&Path>[src]
fn get_paths(&self) -> Vec<&Path>Returns the paths that the rule depends on.
impl<'s, T: Output + Fact> Debug for GivenAllRule<'s, T>[src]
impl<'s, T: Output + Fact> Debug for GivenAllRule<'s, T>Auto Trait Implementations
impl<'rules, T> !Send for GivenAllRule<'rules, T>
impl<'rules, T> !Send for GivenAllRule<'rules, T>impl<'rules, T> !Sync for GivenAllRule<'rules, T>
impl<'rules, T> !Sync for GivenAllRule<'rules, T>