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
use crateKeyPiece;
/// Compile time configuration of a [`GenMap`](crate::GenMap).
/// # Examples
///
/// ```
/// use gen_map::{Config, GenMap};
///
/// /// Four byte keys, and slots get reused forever.
/// struct Small;
///
/// impl Config for Small {
/// // index type
/// type Idx = u16;
/// // generation type
/// type Gen = u16;
/// const WRAP_ON_OVERFLOW: bool = true;
/// }
///
/// let mut map = GenMap::<&str, Small>::new_with_config();
/// let key = map.insert("hello");
/// assert_eq!(core::mem::size_of_val(&key), 4);
/// assert_eq!(map[key], "hello");
/// ```
/// The config a [`GenMap`](crate::GenMap) uses when none is named.
///
/// Keys are `u32` index plus `u32` generation, so eight bytes, and slots retire
/// when their generation overflows.
;