pub struct SyncStorageIo { /* private fields */ }Expand description
Synchronous storage I/O backend.
Executes I/O inline in submit_* calls. Completions are staged in an
internal ring buffer and returned on the next poll_completions call.
Zero heap allocation on the hot path — the completion buffer and fd table are pre-allocated at construction.
Implementations§
Source§impl SyncStorageIo
impl SyncStorageIo
Trait Implementations§
Source§impl Debug for SyncStorageIo
impl Debug for SyncStorageIo
Source§impl Default for SyncStorageIo
impl Default for SyncStorageIo
Source§impl StorageIo for SyncStorageIo
impl StorageIo for SyncStorageIo
Source§fn register_fd(&mut self, file: File) -> Result<IoFd, StorageIoError>
fn register_fd(&mut self, file: File) -> Result<IoFd, StorageIoError>
Register an already-opened file with this backend. Read more
Source§fn deregister_fd(&mut self, fd: IoFd) -> Result<(), StorageIoError>
fn deregister_fd(&mut self, fd: IoFd) -> Result<(), StorageIoError>
Deregister and close a previously registered file. Read more
Source§fn submit_write(
&mut self,
fd: IoFd,
data: &[u8],
offset: u64,
) -> Result<u64, StorageIoError>
fn submit_write( &mut self, fd: IoFd, data: &[u8], offset: u64, ) -> Result<u64, StorageIoError>
Submit a write at the given file offset. Non-blocking. Read more
Source§fn submit_append(
&mut self,
fd: IoFd,
data: &[u8],
) -> Result<u64, StorageIoError>
fn submit_append( &mut self, fd: IoFd, data: &[u8], ) -> Result<u64, StorageIoError>
Submit an append (write at current end-of-file). Non-blocking. Read more
Source§fn submit_datasync(&mut self, fd: IoFd) -> Result<u64, StorageIoError>
fn submit_datasync(&mut self, fd: IoFd) -> Result<u64, StorageIoError>
Submit an
fdatasync (data-only sync, no metadata). Non-blocking. Read moreSource§fn flush(&mut self) -> Result<usize, StorageIoError>
fn flush(&mut self) -> Result<usize, StorageIoError>
Flush pending submissions to the kernel. Read more
Source§fn poll_completions(&mut self, out: &mut Vec<IoCompletion>)
fn poll_completions(&mut self, out: &mut Vec<IoCompletion>)
Poll for completed operations. Non-blocking. Read more
Source§fn pending_count(&self) -> usize
fn pending_count(&self) -> usize
Returns the number of operations submitted but not yet completed.
Auto Trait Implementations§
impl Freeze for SyncStorageIo
impl RefUnwindSafe for SyncStorageIo
impl Send for SyncStorageIo
impl Sync for SyncStorageIo
impl Unpin for SyncStorageIo
impl UnsafeUnpin for SyncStorageIo
impl UnwindSafe for SyncStorageIo
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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<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>
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§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Returns the layout of the type.