pub struct MemoryFileAccess { /* private fields */ }Expand description
Simple in-memory file access for testing.
Implementations§
Trait Implementations§
Source§impl Default for MemoryFileAccess
impl Default for MemoryFileAccess
Source§impl FileAccess for MemoryFileAccess
impl FileAccess for MemoryFileAccess
Source§fn read_file_range(
&self,
file_id: &FileId,
offset: u64,
len: u64,
) -> Result<Vec<u8>>
fn read_file_range( &self, file_id: &FileId, offset: u64, len: u64, ) -> Result<Vec<u8>>
Read a range of bytes from a file identified by its FileId.
Source§fn read_file_range_into(
&self,
file_id: &FileId,
offset: u64,
dst: &mut [u8],
) -> Result<usize>
fn read_file_range_into( &self, file_id: &FileId, offset: u64, dst: &mut [u8], ) -> Result<usize>
Read bytes into a caller-provided buffer, returning the number of bytes read.
Source§fn file_exists(&self, file_id: &FileId) -> bool
fn file_exists(&self, file_id: &FileId) -> bool
Check if a file exists on disk.
Source§fn file_length(&self, file_id: &FileId) -> Option<u64>
fn file_length(&self, file_id: &FileId) -> Option<u64>
Get the actual length of a file on disk.
Source§fn write_file_range(
&mut self,
file_id: &FileId,
offset: u64,
data: &[u8],
) -> Result<()>
fn write_file_range( &mut self, file_id: &FileId, offset: u64, data: &[u8], ) -> Result<()>
Write data to a file at the given offset.
Source§fn open_sequential_reader(
&self,
_file_id: &FileId,
) -> Result<Option<Box<dyn Read>>>
fn open_sequential_reader( &self, _file_id: &FileId, ) -> Result<Option<Box<dyn Read>>>
Open a forward-only reader for hot paths that consume a whole file from offset 0.
Source§fn open_range_reader(
&self,
_file_id: &FileId,
) -> Result<Option<Box<dyn FileRangeReader>>>
fn open_range_reader( &self, _file_id: &FileId, ) -> Result<Option<Box<dyn FileRangeReader>>>
Open a reusable seekable reader for range-oriented repair input.
Auto Trait Implementations§
impl Freeze for MemoryFileAccess
impl RefUnwindSafe for MemoryFileAccess
impl Send for MemoryFileAccess
impl Sync for MemoryFileAccess
impl Unpin for MemoryFileAccess
impl UnsafeUnpin for MemoryFileAccess
impl UnwindSafe for MemoryFileAccess
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