pub trait ReadAt:
Send
+ Sync
+ 'static {
// Required methods
fn read_at(&self, buf: &mut [u8], offset: u64) -> Result<usize>;
fn size(&self) -> Result<u64>;
}
Expand description
Read from a file-like object at an offset.
Required Methods§
Sourcefn read_at(&self, buf: &mut [u8], offset: u64) -> Result<usize>
fn read_at(&self, buf: &mut [u8], offset: u64) -> Result<usize>
Seeks to offset
and performs reads into buf
.
Returns the number of bytes read.
Note that similar to File::read, it is not an error to return with a short read. May or may not move any underlying file pointer, even if the read fails or is short.