pub trait ReadAtSync: Send + Sync {
// Required method
fn read_at(
&self,
buffer: OwnedPages,
len: u32,
offset: u64,
) -> Result<OwnedAlignedBuffer<Align1>, IoBufError<OwnedPages>>;
// Provided method
fn offset(&self, offset: u64) -> ReadAtOffset<'_, Self>
where Self: Sized { ... }
}Expand description
Required Methods§
Sourcefn read_at(
&self,
buffer: OwnedPages,
len: u32,
offset: u64,
) -> Result<OwnedAlignedBuffer<Align1>, IoBufError<OwnedPages>>
fn read_at( &self, buffer: OwnedPages, len: u32, offset: u64, ) -> Result<OwnedAlignedBuffer<Align1>, IoBufError<OwnedPages>>
Read len bytes at offset into buffer, replacing its contents.
The allocation of the buffer is reused when possible and grows otherwise, allocation failure is returned as an error. Existing contents are never copied. On success, the contents are exactly the requested bytes. The buffer is returned back on error too.
The returned buffer can be reused for the next read with
[OwnedAlignedBuffer::into_empty()].
Provided Methods§
Sourcefn offset(&self, offset: u64) -> ReadAtOffset<'_, Self>where
Self: Sized,
fn offset(&self, offset: u64) -> ReadAtOffset<'_, Self>where
Self: Sized,
Get implementation of ReadAtSync that add specified offset to all attempted reads
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".