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:
Eduard S. 2025-02-21 01:55:36 +01:00 committed by GitHub
parent c2d23b0b1b
commit 2e9719a1ca
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 529 additions and 124 deletions

View file

@ -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)),