pub trait BlockRead: Send + Sync {
// Required methods
fn read_at(&self, offset: u64, buf: &mut [u8]) -> Result<()>;
fn size_bytes(&self) -> u64;
}Expand description
Read-only random-access block device.
Required Methods§
Sourcefn read_at(&self, offset: u64, buf: &mut [u8]) -> Result<()>
fn read_at(&self, offset: u64, buf: &mut [u8]) -> Result<()>
Read exactly buf.len() bytes starting at offset (bytes from the
start of the device).
Sourcefn size_bytes(&self) -> u64
fn size_bytes(&self) -> u64
Total device size in bytes. Used for bounds checks.