pub struct CoreRingManager { /* private fields */ }Expand description
Per-core io_uring manager.
Manages a single core’s io_uring instance, buffer pool, and pending operations.
Designed for integration with the thread-per-core architecture.
Implementations§
Source§impl CoreRingManager
impl CoreRingManager
Sourcepub fn new(core_id: usize, config: &IoUringConfig) -> Result<Self, IoUringError>
pub fn new(core_id: usize, config: &IoUringConfig) -> Result<Self, IoUringError>
Sourcepub const fn uses_sqpoll(&self) -> bool
pub const fn uses_sqpoll(&self) -> bool
Check if SQPOLL is enabled.
Sourcepub fn has_iopoll_ring(&self) -> bool
pub fn has_iopoll_ring(&self) -> bool
Check if IOPOLL is enabled.
Sourcepub fn acquire_buffer(&mut self) -> Result<(u16, &mut [u8]), IoUringError>
pub fn acquire_buffer(&mut self) -> Result<(u16, &mut [u8]), IoUringError>
Sourcepub fn release_buffer(&mut self, buf_index: u16)
pub fn release_buffer(&mut self, buf_index: u16)
Release a buffer back to the main pool.
Sourcepub fn submit_read(
&mut self,
fd: RawFd,
buf_index: u16,
offset: u64,
len: u32,
) -> Result<u64, IoUringError>
pub fn submit_read( &mut self, fd: RawFd, buf_index: u16, offset: u64, len: u32, ) -> Result<u64, IoUringError>
Sourcepub fn submit_write(
&mut self,
fd: RawFd,
buf_index: u16,
offset: u64,
len: u32,
) -> Result<u64, IoUringError>
pub fn submit_write( &mut self, fd: RawFd, buf_index: u16, offset: u64, len: u32, ) -> Result<u64, IoUringError>
Sourcepub fn submit_sync(
&mut self,
fd: RawFd,
datasync: bool,
) -> Result<u64, IoUringError>
pub fn submit_sync( &mut self, fd: RawFd, datasync: bool, ) -> Result<u64, IoUringError>
Sourcepub fn submit_close(&mut self, fd: RawFd) -> Result<u64, IoUringError>
pub fn submit_close(&mut self, fd: RawFd) -> Result<u64, IoUringError>
Sourcepub fn submit(&mut self) -> Result<usize, IoUringError>
pub fn submit(&mut self) -> Result<usize, IoUringError>
Submit pending operations to the kernel.
In SQPOLL mode, this is often a no-op since the kernel polls automatically.
§Errors
Returns an error if submission fails.
Sourcepub fn submit_and_wait(&mut self, want: usize) -> Result<usize, IoUringError>
pub fn submit_and_wait(&mut self, want: usize) -> Result<usize, IoUringError>
Sourcepub fn poll_completions(&mut self) -> Vec<Completion>
pub fn poll_completions(&mut self) -> Vec<Completion>
Poll for completions without blocking.
Returns all available completions from both rings.
Allocates a Vec per call — prefer Self::poll_completions_into on hot paths.
Sourcepub fn poll_completions_into(&mut self, out: &mut Vec<Completion>)
pub fn poll_completions_into(&mut self, out: &mut Vec<Completion>)
Poll for completions into a caller-provided buffer. Zero-alloc.
Appends completions to out. The caller should clear out between
iterations to reuse capacity. Uses an internal scratch buffer for
CQE data collection (pre-allocated at ring creation).
Sourcepub fn wait_for(&mut self, user_data: u64) -> Result<Completion, IoUringError>
pub fn wait_for(&mut self, user_data: u64) -> Result<Completion, IoUringError>
Wait for a specific operation to complete.
§Errors
Returns an error if the operation is not found or wait fails.
Sourcepub fn pending_count(&self) -> usize
pub fn pending_count(&self) -> usize
Get the number of pending operations.
Sourcepub fn buffer_pool_stats(&self) -> Option<BufferPoolStats>
pub fn buffer_pool_stats(&self) -> Option<BufferPoolStats>
Get buffer pool statistics.
Sourcepub const fn metrics(&self) -> &RingMetrics
pub const fn metrics(&self) -> &RingMetrics
Get ring metrics.
Trait Implementations§
Source§impl Debug for CoreRingManager
impl Debug for CoreRingManager
Auto Trait Implementations§
impl Freeze for CoreRingManager
impl RefUnwindSafe for CoreRingManager
impl Send for CoreRingManager
impl Sync for CoreRingManager
impl Unpin for CoreRingManager
impl UnsafeUnpin for CoreRingManager
impl UnwindSafe for CoreRingManager
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
§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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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