pub struct ExecutableRule {
pub path: RulePath,
pub name: String,
pub branches: Vec<Branch>,
pub needs_facts: HashSet<FactPath>,
pub source: Option<Source>,
pub rule_type: LemmaType,
}Expand description
An executable rule with flattened branches
Contains all information needed to evaluate a rule without document lookups.
Fields§
§path: RulePathUnique identifier for this rule
name: StringRule name
branches: Vec<Branch>Branches evaluated in order (last matching wins) First branch has condition=None (default expression) Subsequent branches have condition=Some(…) (unless clauses) The evaluation is done in reverse order with the earliest matching branch returning (winning) the result.
needs_facts: HashSet<FactPath>All facts this rule needs (direct + inherited from rule dependencies)
source: Option<Source>Source location for error messages
rule_type: LemmaTypeComputed type of this rule’s result Every rule MUST have a type (Lemma is strictly typed)
Trait Implementations§
Source§impl Clone for ExecutableRule
impl Clone for ExecutableRule
Source§fn clone(&self) -> ExecutableRule
fn clone(&self) -> ExecutableRule
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ExecutableRule
impl Debug for ExecutableRule
Source§impl<'de> Deserialize<'de> for ExecutableRule
impl<'de> Deserialize<'de> for ExecutableRule
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ExecutableRule
impl RefUnwindSafe for ExecutableRule
impl Send for ExecutableRule
impl Sync for ExecutableRule
impl Unpin for ExecutableRule
impl UnwindSafe for ExecutableRule
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§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