Prototype custom predicates (#74)
* wip * prototype custom predicates 1b * feat: implement custom pred recursion * files reorg, add github CI for rustfmt checks --------- Co-authored-by: arnaucube <git@arnaucube.com>
This commit is contained in:
parent
c2d23b0b1b
commit
2e9719a1ca
13 changed files with 529 additions and 124 deletions
|
|
@ -1,8 +1,7 @@
|
|||
use std::fmt;
|
||||
|
||||
use crate::middleware::{hash_str, NativeOperation, NativeStatement};
|
||||
|
||||
use super::{AnchoredKey, SignedPod, Statement, StatementArg, Value};
|
||||
use crate::middleware::{hash_str, NativeOperation, NativePredicate};
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||
pub enum OperationArg {
|
||||
|
|
@ -56,7 +55,7 @@ impl From<(&SignedPod, &str)> for OperationArg {
|
|||
// TODO: Actual value, TryFrom.
|
||||
let value = pod.kvs().get(&hash_str(key)).unwrap().clone();
|
||||
Self::Statement(Statement(
|
||||
NativeStatement::ValueOf,
|
||||
NativePredicate::ValueOf,
|
||||
vec![
|
||||
StatementArg::Key(AnchoredKey(pod.origin(), key.to_string())),
|
||||
StatementArg::Literal(Value::Raw(value)),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue