pub struct GenericRule<Head, Leaf>{
pub span: Span,
pub head: GenericActions<Head, Leaf>,
pub body: Vec<GenericFact<Head, Leaf>>,
pub name: String,
pub ruleset: String,
}Fields§
§span: Span§head: GenericActions<Head, Leaf>§body: Vec<GenericFact<Head, Leaf>>§name: StringA globally unique name for this rule in the EGraph.
ruleset: StringThe ruleset this rule belongs to. Defaults to "".
Implementations§
Source§impl<Head, Leaf> GenericRule<Head, Leaf>
impl<Head, Leaf> GenericRule<Head, Leaf>
Sourcepub fn visit_exprs(
self,
f: &mut impl FnMut(GenericExpr<Head, Leaf>) -> GenericExpr<Head, Leaf>,
) -> GenericRule<Head, Leaf>
pub fn visit_exprs( self, f: &mut impl FnMut(GenericExpr<Head, Leaf>) -> GenericExpr<Head, Leaf>, ) -> GenericRule<Head, Leaf>
Applies f to every expression that appears in the rule body or head.
Sourcepub fn visit_actions(
self,
f: &mut impl FnMut(GenericAction<Head, Leaf>) -> GenericAction<Head, Leaf>,
) -> GenericRule<Head, Leaf>
pub fn visit_actions( self, f: &mut impl FnMut(GenericAction<Head, Leaf>) -> GenericAction<Head, Leaf>, ) -> GenericRule<Head, Leaf>
Applies f to each action in the rule head, leaving the body unchanged.
Sourcepub fn map_symbols<Head2, Leaf2>(
self,
head: &mut impl FnMut(Head) -> Head2,
leaf: &mut impl FnMut(Leaf) -> Leaf2,
) -> GenericRule<Head2, Leaf2>
pub fn map_symbols<Head2, Leaf2>( self, head: &mut impl FnMut(Head) -> Head2, leaf: &mut impl FnMut(Leaf) -> Leaf2, ) -> GenericRule<Head2, Leaf2>
Applies the provided head and leaf mappings to every symbol that appears in the rule.
Sourcepub fn make_unresolved(self) -> GenericRule<String, String>
pub fn make_unresolved(self) -> GenericRule<String, String>
Converts the rule into its unresolved representation by formatting heads and leaves.
Trait Implementations§
Source§impl<Head, Leaf> Clone for GenericRule<Head, Leaf>
impl<Head, Leaf> Clone for GenericRule<Head, Leaf>
Source§fn clone(&self) -> GenericRule<Head, Leaf>
fn clone(&self) -> GenericRule<Head, Leaf>
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<Head, Leaf> Debug for GenericRule<Head, Leaf>
impl<Head, Leaf> Debug for GenericRule<Head, Leaf>
Source§impl<Head, Leaf> Display for GenericRule<Head, Leaf>
impl<Head, Leaf> Display for GenericRule<Head, Leaf>
Source§impl<Head, Leaf> Hash for GenericRule<Head, Leaf>
impl<Head, Leaf> Hash for GenericRule<Head, Leaf>
Source§impl<Head, Leaf> PartialEq for GenericRule<Head, Leaf>
impl<Head, Leaf> PartialEq for GenericRule<Head, Leaf>
impl<Head, Leaf> Eq for GenericRule<Head, Leaf>
impl<Head, Leaf> StructuralPartialEq for GenericRule<Head, Leaf>
Auto Trait Implementations§
impl<Head, Leaf> Freeze for GenericRule<Head, Leaf>
impl<Head, Leaf> RefUnwindSafe for GenericRule<Head, Leaf>where
Leaf: RefUnwindSafe,
Head: RefUnwindSafe,
impl<Head, Leaf> Send for GenericRule<Head, Leaf>
impl<Head, Leaf> Sync for GenericRule<Head, Leaf>
impl<Head, Leaf> Unpin for GenericRule<Head, Leaf>
impl<Head, Leaf> UnwindSafe for GenericRule<Head, Leaf>where
Leaf: UnwindSafe,
Head: UnwindSafe,
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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