eggplant 0.2.4

eggplant is a High-Level Rust API crate for Egglog
Documentation
use eggplant::{basic_tx_no_vt, prelude::*};

#[eggplant::dsl]
enum Cons {
    Value { v: i64, con: Cons },
    End {},
}

#[eggplant::container]
struct VecCon {
    v: VecContainer<Cons>,
}

#[eggplant::dsl]
enum Root {
    V { v: VecCon },
}

#[func(output= Root)]
struct F {}

fn main() {
    env_logger::init();
    let node1 = Value::new(3, &End::<MyTx>::new());
    let mut node2 = Value::new(2, &node1);
    let node3 = Value::new(1, &node2);
    let _root = V::new(&VecCon::new(vec![&node2]));
    println!("node2's current version is {}", node2.cur_sym());
    node2.set_v(4);
    println!("node2's current version is {}", node2.cur_sym());
    let root = V::new(&VecCon::new(vec![&node3]));
    node2.set_v(6);
    println!("node2's current version is {}", node2.cur_sym());
    F::set((), &root);
    MyTx::sgl().to_dot("egraph.dot");
}

basic_tx_no_vt!(MyTx);