pub struct UringIO { /* private fields */ }Implementations§
Trait Implementations§
Source§impl Clock for UringIO
impl Clock for UringIO
Source§fn current_time_monotonic(&self) -> MonotonicInstant
fn current_time_monotonic(&self) -> MonotonicInstant
Monotonic time for timeout checking and elapsed time measurement.
Cheap on real systems (reads TSC), controllable in simulation.
Source§fn current_time_wall_clock(&self) -> WallClockInstant
fn current_time_wall_clock(&self) -> WallClockInstant
Wall-clock time for timestamps (WAL, datetime functions).
Controllable in simulation for deterministic behavior.
Source§impl IO for UringIO
impl IO for UringIO
Source§fn step(&self) -> Result<()>
fn step(&self) -> Result<()>
Drive io_uring forward.
Leader/follower concurrency model:
- Submitters only take
state(briefly, to push an SQE). They’re never blocked by the kernel-side wait, so concurrent submitters pipeline their SQEs into the ring while another thread is waiting on the kernel. - One thread at a time is the leader: it holds
wait_lockand runssubmit_and_wait+drain_cqin a tight loop until the ring drains. The drain must happen while the wait guard is still held — if released before draining, a follower could computepending_opsto include CQEs we’re about to consume and block forever on completions that no longer exist. - Followers (concurrent callers of
step)try_lockthewait_lock. If they lose the race they return immediately: the current leader will fire their waker as it drains. This replaces the previous “block onwait_lockand serialize” behavior, so N concurrent readers no longer queue up N-deep on the kernel call. - Multiple concurrent kernel waiters on the same ring would
themselves deadlock (Linux only wakes one waiter from the
ring’s wait queue when
min_completeis reached), which is the other reason for serializing at this layer.
Whether this IO backend can back host-filesystem shared WAL coordination.
fn open_file( &self, path: &str, flags: OpenFlags, direct: bool, ) -> Result<Arc<dyn File>>
fn remove_file(&self, path: &str) -> Result<()>
fn cancel(&self, completions: &[Completion]) -> Result<()>
fn register_fixed_buffer(&self, ptr: NonNull<u8>, len: usize) -> Result<u32>
Source§fn drain_completions(&self, completions: &[Completion]) -> Result<()>
fn drain_completions(&self, completions: &[Completion]) -> Result<()>
Drive the IO backend until each completion in
completions is
finished(). Used after cancel() (so cancelled ops actually
release their buffers before the caller returns) and after a
single pwrite/pwritev/sync that the caller wants to await
synchronously. Read morefn wait_for_completion(&self, c: Completion) -> Result<()>
fn generate_random_number(&self) -> i64
Source§fn fill_bytes(&self, dest: &mut [u8])
fn fill_bytes(&self, dest: &mut [u8])
Fill
dest with random data.fn get_memory_io(&self) -> Arc<MemoryIO> ⓘ
Source§fn yield_now(&self)
fn yield_now(&self)
Yield the current thread to the scheduler.
Used for backoff in contended lock acquisition.
impl Send for UringIO
impl Sync for UringIO
Auto Trait Implementations§
impl !RefUnwindSafe for UringIO
impl !UnwindSafe for UringIO
impl Freeze for UringIO
impl Unpin for UringIO
impl UnsafeUnpin for UringIO
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<I> IOExt for I
impl<I> IOExt for I
fn block<T>( &self, f: impl FnMut() -> Result<IOResult<T>, LimboError>, ) -> Result<T, LimboError>
async fn wait<T, F>(&self, f: F) -> Result<T, LimboError>
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> ⓘ
Converts
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> ⓘ
Converts
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