pub struct UringIoEngineConfig { /* private fields */ }Expand description
Config for io_uring based I/O engine.
Implementations§
Source§impl UringIoEngineConfig
impl UringIoEngineConfig
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new io_uring based I/O engine config with default configurations.
Sourcepub fn with_threads(self, threads: usize) -> Self
pub fn with_threads(self, threads: usize) -> Self
Set the number of threads to use for the I/O engine.
Sourcepub fn with_cpus(self, cpus: Vec<u32>) -> Self
pub fn with_cpus(self, cpus: Vec<u32>) -> Self
Bind the engine threads to specific CPUs.
The length of cpus must be equal to the threads.
Sourcepub fn with_io_depth(self, io_depth: usize) -> Self
pub fn with_io_depth(self, io_depth: usize) -> Self
Set the I/O depth for each thread.
Sourcepub fn with_iopoll(self, iopoll: bool) -> Self
pub fn with_iopoll(self, iopoll: bool) -> Self
Enable or disable I/O polling.
FYI:
Related syscall flag: IORING_SETUP_IOPOLL.
NOTE:
- If this feature is enabled, the underlying device MUST be opened with the
O_DIRECTflag. - If this feature is enabled, the underlying device MUST support io polling.
Default: false.
Sourcepub fn with_weight(self, weight: f64) -> Self
pub fn with_weight(self, weight: f64) -> Self
Set the weight of read/write priorities.
The engine will try to keep the read/write iodepth ratio as close to the specified weight as possible.
Sourcepub fn with_sqpoll(self, sqpoll: bool) -> Self
pub fn with_sqpoll(self, sqpoll: bool) -> Self
Enable or disable SQ polling.
FYI:
Related syscall flag: IORING_SETUP_IOPOLL.
NOTE: If this feature is enabled, the underlying device must be opened with the O_DIRECT flag.
Default: false.
Sourcepub fn with_sqpoll_cpus(self, cpus: Vec<u32>) -> Self
pub fn with_sqpoll_cpus(self, cpus: Vec<u32>) -> Self
Bind the kernel’s SQ poll thread to the specified cpu.
This flag is only meaningful when Self::with_sqpoll is enabled.
The length of cpus must be equal to the number of threads.
Sourcepub fn with_sqpoll_idle(self, idle: u32) -> Self
pub fn with_sqpoll_idle(self, idle: u32) -> Self
After idle milliseconds, the kernel thread will go to sleep and you will have to wake it up again with a system call.
This flag is only meaningful when Self::with_sqpoll is enabled.
Trait Implementations§
Source§impl Debug for UringIoEngineConfig
impl Debug for UringIoEngineConfig
Source§impl Default for UringIoEngineConfig
impl Default for UringIoEngineConfig
Auto Trait Implementations§
impl Freeze for UringIoEngineConfig
impl RefUnwindSafe for UringIoEngineConfig
impl Send for UringIoEngineConfig
impl Sync for UringIoEngineConfig
impl Unpin for UringIoEngineConfig
impl UnwindSafe for UringIoEngineConfig
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
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more