1#![doc = include_str!("../README.md")]
2#![doc(html_logo_url = "https://avatars.githubusercontent.com/u/79236386")]
3#![doc(html_favicon_url = "https://avatars.githubusercontent.com/u/79236386")]
4
5pub mod prelude {
6 pub use crate::*;
7}
8
9mod root;
10
11pub use atoms::*;
12pub use hooks::*;
13pub use root::*;
14
15mod atoms {
16 mod atom;
17 mod atomfamily;
18 mod atomref;
19 mod selector;
20 mod selectorfamily;
21
22 pub use atom::*;
23 pub use atomfamily::*;
24 pub use atomref::*;
25 pub use selector::*;
26 pub use selectorfamily::*;
27}
28
29pub mod hooks {
30 mod atom_ref;
31 mod atom_root;
32 mod init_atom_root;
33 mod read;
34 mod set;
35 mod state;
36 pub use atom_ref::*;
37 pub use atom_root::*;
38 pub use init_atom_root::*;
39 pub use read::*;
40 pub use set::*;
41 pub use state::*;
42}
43
44pub trait Readable<V> {
49 fn read(&self, root: AtomRoot) -> Option<V>;
50 fn init(&self) -> V;
51 fn unique_id(&self) -> AtomId;
52}
53
54pub trait Writable<V>: Readable<V> {
59 fn write(&self, root: AtomRoot, value: V);
60}