Struct holmes::engine::types::Clause
[−]
[src]
pub struct Clause { pub pred_name: String, pub args: Vec<(Projection, MatchExpr)>, }
A Clause
to be matched against, as you would see in the body of a datalog
rule.
Continuing with our running example,
foo(_, x)
(match all foo
s, bind the second slot to x) would be constructed as
use holmes::engine::types::{Clause,MatchExpr,Projection}; Clause { pred_name : "foo".to_string(), args : vec![(Projection::Slot(0), MatchExpr::Unbound), (Projection::Slot(1), MatchExpr::Var(0))] };
Fields
pred_name: String
Name of the predicate to match against
args: Vec<(Projection, MatchExpr)>
List of how to restrict or bind each slot
Trait Implementations
impl PartialEq for Clause
[src]
fn eq(&self, __arg_0: &Clause) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Clause) -> bool
This method tests for !=
.
impl Clone for Clause
[src]
fn clone(&self) -> Clause
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl Debug for Clause
[src]
impl Hash for Clause
[src]
fn hash<__H: Hasher>(&self, __arg_0: &mut __H)
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more