pub struct RuleInheritance {
pub base_rule: String,
pub derived_rule: String,
pub additional_body: Vec<RuleAtom>,
pub additional_head: Vec<RuleAtom>,
pub override_body: Option<Vec<RuleAtom>>,
pub override_head: Option<Vec<RuleAtom>>,
}Expand description
Rule inheritance for creating derived rules
Fields§
§base_rule: StringBase rule name
derived_rule: StringDerived rule name
additional_body: Vec<RuleAtom>Additional body atoms
additional_head: Vec<RuleAtom>Additional head atoms
override_body: Option<Vec<RuleAtom>>Override body (if Some, replaces base body)
override_head: Option<Vec<RuleAtom>>Override head (if Some, replaces base head)
Implementations§
Source§impl RuleInheritance
impl RuleInheritance
Sourcepub fn new(base_rule: String, derived_rule: String) -> Self
pub fn new(base_rule: String, derived_rule: String) -> Self
Create new inheritance relationship
Sourcepub fn add_body_atoms(&mut self, atoms: Vec<RuleAtom>)
pub fn add_body_atoms(&mut self, atoms: Vec<RuleAtom>)
Add additional body atoms
Sourcepub fn add_head_atoms(&mut self, atoms: Vec<RuleAtom>)
pub fn add_head_atoms(&mut self, atoms: Vec<RuleAtom>)
Add additional head atoms
Sourcepub fn set_body_override(&mut self, body: Vec<RuleAtom>)
pub fn set_body_override(&mut self, body: Vec<RuleAtom>)
Set override body (completely replaces base body)
Sourcepub fn set_head_override(&mut self, head: Vec<RuleAtom>)
pub fn set_head_override(&mut self, head: Vec<RuleAtom>)
Set override head (completely replaces base head)
Trait Implementations§
Source§impl Clone for RuleInheritance
impl Clone for RuleInheritance
Auto Trait Implementations§
impl Freeze for RuleInheritance
impl RefUnwindSafe for RuleInheritance
impl Send for RuleInheritance
impl Sync for RuleInheritance
impl Unpin for RuleInheritance
impl UnsafeUnpin for RuleInheritance
impl UnwindSafe for RuleInheritance
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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