pub trait ImageSource: Send + Sync {
// Required methods
fn len(&self) -> u64;
fn read_at(&self, offset: u64, buf: &mut [u8]) -> VfsResult<usize>;
// Provided methods
fn is_empty(&self) -> bool { ... }
fn extents(&self) -> Extents { ... }
fn view(&self, offset: u64, len: usize) -> Option<SourceView<'_>> { ... }
fn source_id(&self) -> SourceId { ... }
}Expand description
A read-only, randomly-addressable byte stream: a decoded container, a
partition window, a decrypted volume, a VSS store, a file’s data, or a byte
range of any of them. Send + Sync; positioned reads only; no writer.
Required Methods§
Provided Methods§
Sourcefn extents(&self) -> Extents
fn extents(&self) -> Extents
Allocated-extent map. Default = one dense extent covering [0, len).
Sourcefn view(&self, offset: u64, len: usize) -> Option<SourceView<'_>>
fn view(&self, offset: u64, len: usize) -> Option<SourceView<'_>>
Optional zero-copy fast path. None when the backing cannot lend a
contiguous view (the caller then uses ImageSource::read_at).
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".