pub struct Rule<'a> {
pub name: &'a str,
pub application: fn(_: &Expression, _: &Model) -> Result<Reduction, ApplicationError>,
pub rule_sets: &'a [(&'a str, u16)],
}
Expand description
A rule with a name, application function, and rule sets.
§Fields
name
The name of the rule.application
The function to apply the rule.rule_sets
A list of rule set names and priorities that this rule is a part of. This is used to populate rulesets at runtime.
Fields§
§name: &'a str
§application: fn(_: &Expression, _: &Model) -> Result<Reduction, ApplicationError>
§rule_sets: &'a [(&'a str, u16)]
Implementations§
Trait Implementations§
impl Eq for Rule<'_>
Auto Trait Implementations§
impl<'a> Freeze for Rule<'a>
impl<'a> RefUnwindSafe for Rule<'a>
impl<'a> Send for Rule<'a>
impl<'a> Sync for Rule<'a>
impl<'a> Unpin for Rule<'a>
impl<'a> UnwindSafe for Rule<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more