mnem_core/objects/mod.rs
1//! Canonical object types: Node, Edge, Tree, Commit, Operation, View.
2//!
3//! Each type serializes and deserializes as canonical DAG-CBOR (SPEC §3, §4).
4//! Every Rust struct in this module has the `_kind` discriminator baked in
5//! via a custom (de)serialize pair, so a Node encoded on the wire cannot
6//! round-trip into an Edge by accident.
7//!
8//! Forward-compat per SPEC §3.2: every object type carries an `extra:
9//! BTreeMap<String, Ipld>` extension map that catches fields this version
10//! doesn't know about. The extras are preserved on re-encode so that
11//! signed objects remain verifiable across version upgrades.
12
13pub mod commit;
14pub mod edge;
15pub mod embedding_set;
16pub mod index_set;
17pub mod node;
18pub mod operation;
19pub mod tombstone;
20pub mod view;
21
22pub use commit::{Commit, Signature};
23pub use edge::Edge;
24pub use embedding_set::{EmbeddingBucket, EmbeddingEntry};
25pub use index_set::{
26 AdjacencyBucket, AdjacencyEntry, IncomingAdjacencyBucket, IncomingAdjacencyEntry, IndexSet,
27};
28pub use node::{Dtype, Embedding, Node};
29pub use operation::Operation;
30pub use tombstone::Tombstone;
31pub use view::{RefTarget, View};