use crate::{AtomId, AtomRoot, Readable, Writable}; pub type Atom = fn(AtomBuilder) -> T; pub struct AtomBuilder; impl Readable for Atom { fn read(&self, _root: AtomRoot) -> Option { todo!() } fn init(&self) -> V { (*self)(AtomBuilder) } fn unique_id(&self) -> AtomId { *self as *const () } } impl Writable for Atom { fn write(&self, _root: AtomRoot, _value: V) { todo!() } } #[test] fn atom_compiles() { static TEST_ATOM: Atom<&str> = |_| "hello"; dbg!(TEST_ATOM.init()); }