1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
//! Integration with the armour ecosystem (feature `armour`).
//!
//! Provides multi-tree database management, schema-versioned migrations,
//! and a binary RPC server compatible with armour-rpc clients.
//!
//! # Components
//!
//! - [`Db`] — manages a directory of named collections with persistent
//! metadata ([`DbInfo`]) and sequential ID generation.
//! - [`TreeMeta`] — static descriptor for a collection (name, key scheme, type, version).
//! - [`Db::open_typed_tree`] / [`Db::open_typed_map`] /
//! [`Db::open_zero_tree`] / [`Db::open_zero_map`] —
//! open a tree or map with automatic migration when the stored schema version
//! differs from [`TreeMeta::version`].
//! - [`RpcHandler`] — trait for handling binary RPC requests per collection.
//! - [`TypedTreeHandler`] — [`RpcHandler`] implementation that bridges
//! bytes-level RPC to a [`TypedTree`](crate::TypedTree) via a [`Codec`](crate::Codec).
//! - [`TreeMap`] — `Arc<HashMap<u64, Arc<dyn RpcHandler>>>` routing table
//! (key = `xxh3(name)`).
//!
//! # Quick start
//!
//! ```ignore
//! use std::sync::Arc;
//! use armdb::armour::{Db, TypedTreeHandler, TreeMap};
//! use armdb::RapiraCodec;
//!
//! let db = Db::open("data/myapp")?;
//! let tree = Arc::new(db.open_typed_tree::<User, _>(RapiraCodec, &[])?);
//!
//! // Register handler and start RPC server
//! let trees: TreeMap = Arc::new(/* hashname -> handler */);
//! db.listen_tcp(trees.clone(), "127.0.0.1:9000");
//! db.listen_uds(trees, "/tmp/myapp.sock");
//! ```
//!
//! # RPC protocol
//!
//! Length-delimited frames over TCP or Unix socket. Each request carries an
//! opcode, a collection hashname (`xxh3` of the collection name), and an
//! operation-specific payload. See [`rpc`] module for codec details.
//!
//! Graceful shutdown: Ctrl-C sends a broadcast via `async_broadcast`;
//! all accept loops and active connections terminate.
pub use crate::;
pub use Collection;
pub use ;
pub use ;
pub use ;
pub use TreeMap;
pub use SeqGen;
pub use TypedRpcClient;