INNER CODE UNIT · Rust
new
lurk-lab/lurk-beta · chain-server/src/lib.rs:78
pub fn new(callable: &Ptr, argument: &Ptr, store: &Store<F>) -> Self {
let cache = &mut HashMap::default();
let mut z_dag = ZDag::default();
let callable = z_dag.populate_with(callable, store, cache);
let argument = z_dag.populate_with(argument, store, cache);
Self {
callable,
argument,
z_dag,
}
}
pub fn interned(&self, store: &Store<F>) -> Result<(Ptr, Ptr)> {
let cache = &mut HashMap::default();
let callable = self.z_dag.populate_store(&self.callable, store, cache)?;
let argument = self.z_dag.populate_store(&self.argument, store, cache)?;
Ok((callable, argument))
}