pub struct TableAction { /* private fields */ }Expand description
This is an intern-able struct that holds all the data needed
to do table operations with an ExecutionState, assuming
that the FunctionId for the table is known ahead of time.
Implementations§
Source§impl TableAction
 
impl TableAction
Sourcepub fn new(egraph: &EGraph, func: FunctionId) -> TableAction
 
pub fn new(egraph: &EGraph, func: FunctionId) -> TableAction
Create a new TableAction to be used later.
This requires access to the egglog_bridge::EGraph.
Sourcepub fn lookup(
    &self,
    state: &mut ExecutionState<'_>,
    key: &[Value],
) -> Option<Value>
 
pub fn lookup( &self, state: &mut ExecutionState<'_>, key: &[Value], ) -> Option<Value>
A “table lookup” is not a read-only operation. It will insert a row when
the DefaultVal for the table is not DefaultVal::Fail and
the args in [Lookup::run] are not already present in the table.
Sourcepub fn insert(
    &mut self,
    state: &mut ExecutionState<'_>,
    row: impl Iterator<Item = Value>,
)
 
pub fn insert( &mut self, state: &mut ExecutionState<'_>, row: impl Iterator<Item = Value>, )
Insert a row into this table.
Sourcepub fn remove(&self, state: &mut ExecutionState<'_>, key: &[Value])
 
pub fn remove(&self, state: &mut ExecutionState<'_>, key: &[Value])
Delete a row from this table.
Sourcepub fn subsume(
    &mut self,
    state: &mut ExecutionState<'_>,
    key: impl Iterator<Item = Value>,
)
 
pub fn subsume( &mut self, state: &mut ExecutionState<'_>, key: impl Iterator<Item = Value>, )
Subsume a row in this table.
Trait Implementations§
Source§impl Clone for TableAction
 
impl Clone for TableAction
Source§impl Debug for TableAction
 
impl Debug for TableAction
Source§impl Hash for TableAction
 
impl Hash for TableAction
Source§impl PartialEq for TableAction
 
impl PartialEq for TableAction
impl Eq for TableAction
impl StructuralPartialEq for TableAction
Auto Trait Implementations§
impl Freeze for TableAction
impl RefUnwindSafe for TableAction
impl Send for TableAction
impl Sync for TableAction
impl Unpin for TableAction
impl UnwindSafe for TableAction
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