pub struct StorageSession { /* private fields */ }Expand description
Reusable storage queue with bounded payload ownership and one service thread. Opening a session requires a stream in the process-lifetime native domain.
Implementations§
Source§impl StorageSession
impl StorageSession
Sourcepub fn new(
stream: &Stream,
files: &[File],
config: StorageConfig,
) -> Result<Self>
pub fn new( stream: &Stream, files: &[File], config: StorageConfig, ) -> Result<Self>
Register files and allocate all payload slots before accepting requests.
Sourcepub fn read_chunk_bytes(&self) -> usize
pub fn read_chunk_bytes(&self) -> usize
Maximum logical read bytes guaranteed to fit despite direct-I/O padding.
Sourcepub fn read(&self, file: usize, offset: u64, bytes: usize) -> Result<ReadTicket>
pub fn read(&self, file: usize, offset: u64, bytes: usize) -> Result<ReadTicket>
Read an exact immutable extent. Identical retained reads share one slot. Files must not be written through another handle while a shared read lives.
Sourcepub fn write(
&self,
file: usize,
offset: u64,
bytes: &[u8],
) -> Result<ReadTicket>
pub fn write( &self, file: usize, offset: u64, bytes: &[u8], ) -> Result<ReadTicket>
Copy host bytes into an owned slot and submit a positioned write. Completion reports transferred bytes, not power-loss durability. Returns Busy when another slot has active device use: host writes obey the registered allocation’s whole-buffer access exclusion.
Sourcepub fn statistics(&self) -> StorageStatistics
pub fn statistics(&self) -> StorageStatistics
Snapshot counters without waiting for outstanding operations.
Trait Implementations§
Source§impl Drop for StorageSession
impl Drop for StorageSession
Auto Trait Implementations§
impl !RefUnwindSafe for StorageSession
impl !UnwindSafe for StorageSession
impl Freeze for StorageSession
impl Send for StorageSession
impl Sync for StorageSession
impl Unpin for StorageSession
impl UnsafeUnpin for StorageSession
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> DropFlavorWrapper<T> for T
impl<T> DropFlavorWrapper<T> for T
Source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
Source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
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