pub struct ChunkedBlockIo<F>{
ctx: IsoReadContext,
read_fn: F,
block_size: u32,
total_sectors: u64,
}Expand description
Block I/O adapter for chunked ISO storage
Implements a virtual block device over chunked partitions.
Fields§
§ctx: IsoReadContextISO read context (chunk locations)
read_fn: FCallback to read from underlying disk
block_size: u32Cached block size
total_sectors: u64Total sectors in virtual device
Implementations§
Source§impl<F> ChunkedBlockIo<F>
impl<F> ChunkedBlockIo<F>
Sourcepub fn new(ctx: IsoReadContext, read_fn: F) -> Self
pub fn new(ctx: IsoReadContext, read_fn: F) -> Self
Create a new chunked block I/O adapter
§Arguments
ctx- ISO read context with chunk partition inforead_fn- Callback to read from disk:fn(lba, buffer) -> Result
Sourcepub fn total_size(&self) -> u64
pub fn total_size(&self) -> u64
Get total size in bytes
Sourcepub fn total_sectors(&self) -> u64
pub fn total_sectors(&self) -> u64
Get total number of sectors
Sourcefn find_chunk_for_lba(&self, virtual_lba: u64) -> Option<(usize, u64)>
fn find_chunk_for_lba(&self, virtual_lba: u64) -> Option<(usize, u64)>
Find which chunk contains a given virtual LBA
Trait Implementations§
Source§impl<F> VirtualBlockIo for ChunkedBlockIo<F>
impl<F> VirtualBlockIo for ChunkedBlockIo<F>
Auto Trait Implementations§
impl<F> Freeze for ChunkedBlockIo<F>where
F: Freeze,
impl<F> RefUnwindSafe for ChunkedBlockIo<F>where
F: RefUnwindSafe,
impl<F> Send for ChunkedBlockIo<F>where
F: Send,
impl<F> Sync for ChunkedBlockIo<F>where
F: Sync,
impl<F> Unpin for ChunkedBlockIo<F>where
F: Unpin,
impl<F> UnwindSafe for ChunkedBlockIo<F>where
F: UnwindSafe,
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
Mutably borrows from an owned value. Read more