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
68
69
70
71
72
73
74
use ;
use crateKey;
/// Metadata about a named tree/map collection.
/// Trait for types that carry enough metadata to describe an armdb collection.
///
/// Provides the constants needed to construct a [`TreeMeta`]:
/// name, version, and value type (`Typ` via [`GetType`]).
/// Key metadata (`KeyScheme`, `GROUP_BITS`) comes from the associated
/// [`SelfId`](CollectionMeta::SelfId) type via the [`Key`] trait.
///
/// # Example
///
/// ```ignore
/// use armdb::{CollectionMeta, Key, TreeMeta, impl_key_zerocopy};
/// use armour_core::{GetType, KeyScheme, KeyType};
///
/// #[derive(FromBytes, IntoBytes, Immutable, Copy, Clone)]
/// #[repr(transparent)]
/// struct UserId([u8; 8]);
///
/// impl_key_zerocopy!(UserId, KeyScheme::Typed(&[KeyType::Fuid]), group_bits = 10);
///
/// #[derive(GetType, Rapira)]
/// struct User {
/// name: String,
/// email: String,
/// }
///
/// impl CollectionMeta for User {
/// type SelfId = UserId;
/// const NAME: &'static str = "users";
/// const VERSION: u16 = 1;
/// }
///
/// const META: TreeMeta = TreeMeta::of::<User>();
/// ```