Skip to main content

santh_bufpool/
config.rs

1/// Configuration for a [`BufferPool`](crate::BufferPool).
2///
3/// # Examples
4///
5/// ```rust
6/// use santh_bufpool::PoolConfig;
7///
8/// let config = PoolConfig {
9///     four_kib_count: 4,
10///     sixty_four_kib_count: 2,
11///     two_fifty_six_kib_count: 1,
12///     one_mib_count: 0,
13///     numa_node: None,
14/// };
15/// assert_eq!(config.four_kib_count, 4);
16/// ```
17#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
18pub struct PoolConfig {
19    /// Number of 4 KiB buffers to preallocate.
20    pub four_kib_count: usize,
21    /// Number of 64 KiB buffers to preallocate.
22    pub sixty_four_kib_count: usize,
23    /// Number of 256 KiB buffers to preallocate.
24    pub two_fifty_six_kib_count: usize,
25    /// Number of 1 MiB buffers to preallocate.
26    pub one_mib_count: usize,
27    /// Optional NUMA node for initial placement (requires the `numa` feature).
28    pub numa_node: Option<u32>,
29}