use crate::{AtomId, AtomRoot, Readable}; use std::cell::RefCell; pub struct AtomRefBuilder; pub type AtomRef = fn(AtomRefBuilder) -> T; impl Readable> for AtomRef { fn read(&self, _root: AtomRoot) -> Option> { todo!() } fn init(&self) -> RefCell { RefCell::new((*self)(AtomRefBuilder)) } fn unique_id(&self) -> AtomId { AtomId { ptr: *self as *const (), type_id: std::any::TypeId::of::(), } } } #[test] fn atom_compiles() { static TEST_ATOM: AtomRef> = |_| vec![]; dbg!(TEST_ATOM.init()); }