pub enum GenericFact<Head, Leaf> {
Eq(Span, GenericExpr<Head, Leaf>, GenericExpr<Head, Leaf>),
Fact(GenericExpr<Head, Leaf>),
}Expand description
Facts are the left-hand side of a [Command::Rule].
They represent a part of a database query.
Facts can be expressions or equality constraints between expressions.
Note that primitives such as != are partial.
When two things are equal, it returns nothing and the query does not match.
For example, the following egglog code runs:
(fail (check (!= 1 1)))Variants§
Eq(Span, GenericExpr<Head, Leaf>, GenericExpr<Head, Leaf>)
Fact(GenericExpr<Head, Leaf>)
Implementations§
Source§impl<Head, Leaf> GenericFact<Head, Leaf>
impl<Head, Leaf> GenericFact<Head, Leaf>
pub fn visit_exprs( self, f: &mut impl FnMut(GenericExpr<Head, Leaf>) -> GenericExpr<Head, Leaf>, ) -> GenericFact<Head, Leaf>
pub fn map_exprs<Head2, Leaf2>( &self, f: &mut impl FnMut(&GenericExpr<Head, Leaf>) -> GenericExpr<Head2, Leaf2>, ) -> GenericFact<Head2, Leaf2>
pub fn subst<Leaf2, Head2>( &self, subst_leaf: &mut impl FnMut(&Span, &Leaf) -> GenericExpr<Head2, Leaf2>, subst_head: &mut impl FnMut(&Head) -> Head2, ) -> GenericFact<Head2, Leaf2>
Source§impl<Head, Leaf> GenericFact<Head, Leaf>
impl<Head, Leaf> GenericFact<Head, Leaf>
pub fn make_unresolved(self) -> GenericFact<String, String>
Trait Implementations§
Source§impl<Head: Clone, Leaf: Clone> Clone for GenericFact<Head, Leaf>
impl<Head: Clone, Leaf: Clone> Clone for GenericFact<Head, Leaf>
Source§fn clone(&self) -> GenericFact<Head, Leaf>
fn clone(&self) -> GenericFact<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 moreimpl<Head: Eq, Leaf: Eq> Eq for GenericFact<Head, Leaf>
impl<Head, Leaf> StructuralPartialEq for GenericFact<Head, Leaf>
Auto Trait Implementations§
impl<Head, Leaf> Freeze for GenericFact<Head, Leaf>
impl<Head, Leaf> RefUnwindSafe for GenericFact<Head, Leaf>where
Leaf: RefUnwindSafe,
Head: RefUnwindSafe,
impl<Head, Leaf> Send for GenericFact<Head, Leaf>
impl<Head, Leaf> Sync for GenericFact<Head, Leaf>
impl<Head, Leaf> Unpin for GenericFact<Head, Leaf>
impl<Head, Leaf> UnwindSafe for GenericFact<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