feat: integrate fermi

This commit is contained in:
Jonathan Kelley committed 2022-02-17 10:38:51 -05:00
1 parent 3873cd1a60
commit d461ffc011
23 files changed
+630 -15

No files matched your search

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