pub struct MempoolConfig {
pub n: u32,
pub cache_size: u32,
pub data_room_size: u16,
pub socket_id: i32,
}Expand description
Configuration for creating a mempool
Fields§
§n: u32Number of elements in the pool
cache_size: u32Per-core cache size (0 to disable caching)
data_room_size: u16Size of data buffer in each mbuf
socket_id: i32NUMA socket ID (-1 for any socket)
Implementations§
Source§impl MempoolConfig
impl MempoolConfig
Sourcepub fn with_cache_size(self, cache_size: u32) -> Self
pub fn with_cache_size(self, cache_size: u32) -> Self
Set the cache size
Sourcepub fn with_data_room_size(self, size: u16) -> Self
pub fn with_data_room_size(self, size: u16) -> Self
Set the data room size
Sourcepub fn with_socket_id(self, socket_id: i32) -> Self
pub fn with_socket_id(self, socket_id: i32) -> Self
Set the NUMA socket ID
Trait Implementations§
Source§impl Clone for MempoolConfig
impl Clone for MempoolConfig
Source§fn clone(&self) -> MempoolConfig
fn clone(&self) -> MempoolConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MempoolConfig
impl Debug for MempoolConfig
Auto Trait Implementations§
impl Freeze for MempoolConfig
impl RefUnwindSafe for MempoolConfig
impl Send for MempoolConfig
impl Sync for MempoolConfig
impl Unpin for MempoolConfig
impl UnsafeUnpin for MempoolConfig
impl UnwindSafe for MempoolConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more