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
/// Errors of the L0 primitives.
///
/// The enum and its struct variants are `#[non_exhaustive]`: match with `..` and a wildcard arm.
///
/// ```
/// use pragma_base::{BaseError, HandlePool};
///
/// let mut pool = HandlePool::new();
/// let h = pool.insert(1_u8)?;
/// pool.remove(h)?;
/// match pool.remove(h) {
/// Err(BaseError::StaleHandle { index, .. }) => assert_eq!(index, h.index()),
/// Err(other) => return Err(other),
/// Ok(_) => unreachable!("the handle was already removed"),
/// }
/// # Ok::<(), BaseError>(())
/// ```