pub struct IoUringConfig {
pub ring_entries: u32,
pub mode: RingMode,
pub sqpoll_idle_ms: u32,
pub sqpoll_cpu: Option<u32>,
pub buffer_size: usize,
pub buffer_count: usize,
pub coop_taskrun: bool,
pub single_issuer: bool,
pub direct_table: bool,
pub direct_table_size: u32,
}Expand description
Configuration for io_uring operations.
Fields§
§ring_entries: u32Number of submission queue entries (power of 2, typically 256-4096).
mode: RingModeRing operation mode.
sqpoll_idle_ms: u32SQPOLL idle timeout in milliseconds before kernel thread sleeps. Only used when mode uses SQPOLL.
sqpoll_cpu: Option<u32>CPU to pin the SQPOLL kernel thread to (usually same NUMA node as core). Only used when mode uses SQPOLL.
buffer_size: usizeSize of each registered buffer in bytes (typically 64KB).
buffer_count: usizeNumber of buffers in the registered pool.
coop_taskrun: boolEnable cooperative task running to reduce kernel-userspace transitions.
single_issuer: boolOptimize for single-threaded submission (thread-per-core model).
direct_table: boolEnable direct file descriptor table for faster operations.
direct_table_size: u32Number of direct file descriptor slots.
Implementations§
Source§impl IoUringConfig
impl IoUringConfig
Sourcepub fn builder() -> IoUringConfigBuilder
pub fn builder() -> IoUringConfigBuilder
Create a new builder for IoUringConfig.
Sourcepub fn auto() -> Self
pub fn auto() -> Self
Create configuration with automatic detection.
Detects system capabilities and generates an optimal configuration:
- Enables SQPOLL mode on Linux 5.11+ with the io-uring feature
- Enables IOPOLL mode on Linux 5.19+ with
NVMestorage - Uses optimal buffer sizes based on available memory
§Example
use laminar_core::io_uring::IoUringConfig;
let config = IoUringConfig::auto();
println!("SQPOLL: {}", config.mode.uses_sqpoll());Sourcepub const fn total_buffer_size(&self) -> usize
pub const fn total_buffer_size(&self) -> usize
Total buffer pool size in bytes.
Trait Implementations§
Source§impl Clone for IoUringConfig
impl Clone for IoUringConfig
Source§fn clone(&self) -> IoUringConfig
fn clone(&self) -> IoUringConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for IoUringConfig
impl Debug for IoUringConfig
Auto Trait Implementations§
impl Freeze for IoUringConfig
impl RefUnwindSafe for IoUringConfig
impl Send for IoUringConfig
impl Sync for IoUringConfig
impl Unpin for IoUringConfig
impl UnwindSafe for IoUringConfig
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.