pub trait ReadObjectHandle: ObjectHandle {
// Required methods
fn read_aligned<'life0, 'life1, 'async_trait>(
&'life0 self,
offset: u64,
buf: MutableBufferRef<'life1>,
) -> Pin<Box<dyn Future<Output = Result<usize, Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn get_size(&self) -> u64;
}Required Methods§
Sourcefn read_aligned<'life0, 'life1, 'async_trait>(
&'life0 self,
offset: u64,
buf: MutableBufferRef<'life1>,
) -> Pin<Box<dyn Future<Output = Result<usize, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn read_aligned<'life0, 'life1, 'async_trait>(
&'life0 self,
offset: u64,
buf: MutableBufferRef<'life1>,
) -> Pin<Box<dyn Future<Output = Result<usize, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Fills buf with bytes read from offset on the underlying device.
Both offset and buf.len() must be aligned to the object’s block_size().
Returns the number of bytes read. If offset >= size, returns 0. Holes/sparse extents
within the read range are zero-filled. Callers should not make any assumptions about the
contents of the buffer past the returned read amount.
Trait Implementations§
Source§impl LayerObject for dyn ReadObjectHandle + '_
impl LayerObject for dyn ReadObjectHandle + '_
Source§fn as_slice(&self) -> Option<&[u8]>
fn as_slice(&self) -> Option<&[u8]>
Returns a memory-mapped slice of the entire layer file if supported (e.g. when backed by a
pager-managed VMO).
Source§fn has_io_error(&self) -> bool
fn has_io_error(&self) -> bool
Returns true if an underlying I/O error occurred while paging in data for this object.
Source§fn purge_cached_data(&self)
fn purge_cached_data(&self)
Requests that cached data (such as paged-in pages) for this object be purged.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".