pub struct FileSectorSource { /* private fields */ }Expand description
SectorSource backed by a file (ISO image). Every read_sectors
call is a direct seek + read_exact against the underlying file
— kernel readahead handles prefetch, and every
[READ_DROP_CHUNK_BYTES_DEFAULT] bytes of consumed data the
platform’s DONTNEED hook drops the consumed window from the
page cache to bound memory pressure.
Implementations§
Source§impl FileSectorSource
impl FileSectorSource
Sourcepub fn open(path: &Path) -> Result<Self>
pub fn open(path: &Path) -> Result<Self>
Open an existing ISO file for reading. Capacity is derived
from metadata().len() / 2048. Returns
Error::IsoTooLarge if the file would exceed the 32-bit
LBA address space (~8 TB).
Issues the platform’s “sequential access expected” hint on the
fd (Linux posix_fadvise(SEQUENTIAL), macOS fcntl(F_RDADVISE),
Windows TODO stub) so the kernel’s readahead widens.
Trait Implementations§
Source§impl SectorSource for FileSectorSource
impl SectorSource for FileSectorSource
Source§fn capacity_sectors(&self) -> u32
fn capacity_sectors(&self) -> u32
Total capacity in sectors, if known. Default
0 = unknown
(e.g. live drives that haven’t completed READ CAPACITY yet).Source§fn read_sectors(
&mut self,
lba: u32,
count: u16,
out: &mut [u8],
_recovery: bool,
) -> Result<usize>
fn read_sectors( &mut self, lba: u32, count: u16, out: &mut [u8], _recovery: bool, ) -> Result<usize>
Read
count sectors starting at lba into buf.
buf must be at least count * 2048 bytes.
recovery: true = full retry/reset loop (ripping),
false = single attempt (verify). File-backed sources ignore
the flag. Read moreAuto Trait Implementations§
impl Freeze for FileSectorSource
impl RefUnwindSafe for FileSectorSource
impl Send for FileSectorSource
impl Sync for FileSectorSource
impl Unpin for FileSectorSource
impl UnsafeUnpin for FileSectorSource
impl UnwindSafe for FileSectorSource
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
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>
Converts
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>
Converts
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