pub struct FileSource { /* private fields */ }Expand description
Wrap a raw OS file as an ImageSource using positioned reads
(pread/seek_read) — NOT a Mutex<Seek>, so parallel workers never
serialize on one cursor at the bottom of the stack.
Implementations§
Trait Implementations§
Source§impl ImageSource for FileSource
impl ImageSource for FileSource
Source§fn read_at(&self, offset: u64, buf: &mut [u8]) -> VfsResult<usize>
fn read_at(&self, offset: u64, buf: &mut [u8]) -> VfsResult<usize>
Fill
buf starting at byte offset. Returns bytes read (0 at/after EOF).
Never panics; a short read past EOF returns the available prefix length.Source§fn extents(&self) -> Extents
fn extents(&self) -> Extents
Allocated-extent map. Default = one dense extent covering
[0, len).Source§fn 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).Auto Trait Implementations§
impl Freeze for FileSource
impl RefUnwindSafe for FileSource
impl Send for FileSource
impl Sync for FileSource
impl Unpin for FileSource
impl UnsafeUnpin for FileSource
impl UnwindSafe for FileSource
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