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
//! Capacity type/s describing all the capacities requires within the io_uring bearer.
//! We integrate the capacity crate to describe the capacities.
/// Describes all the different intended fixed capacity used in the bearer.
/// ```rust
/// use io_uring_bearer::BearerCapacityKind;
/// use capacity::{Capacity, Setting};
///
/// #[derive(Clone, Debug)]
/// pub struct MyCapacity;
///
/// impl Setting<BearerCapacityKind> for MyCapacity {
/// fn setting(&self, v: &BearerCapacityKind) -> usize {
/// match v {
/// BearerCapacityKind::CoreQueue => 1,
/// BearerCapacityKind::RegisteredFd => 2,
/// BearerCapacityKind::PendingCompletions => 3,
/// BearerCapacityKind::Buffers => 4,
/// BearerCapacityKind::Futexes => 5,
/// }
/// }
/// }
/// fn main() {
/// let my_cap = Capacity::<MyCapacity, BearerCapacityKind>::with_planned(MyCapacity {});
/// }
/// ```