pub trait FileExt {
// Required methods
fn read_at(&self, buf: &mut [u8], offset: u64) -> Result<usize>;
fn write_at(&self, buf: &[u8], offset: u64) -> Result<usize>;
// Provided methods
fn read_vectored_at(
&self,
bufs: &mut [IoSliceMut<'_>],
offset: u64,
) -> Result<usize> { ... }
fn read_exact_at(&self, buf: &mut [u8], offset: u64) -> Result<()> { ... }
fn write_vectored_at(
&self,
bufs: &[IoSlice<'_>],
offset: u64,
) -> Result<usize> { ... }
fn write_all_at(&self, buf: &[u8], offset: u64) -> Result<()> { ... }
}
Expand description
Unix-specific extensions to [fs::File
].
Required Methods§
Provided Methods§
Sourcefn read_vectored_at(
&self,
bufs: &mut [IoSliceMut<'_>],
offset: u64,
) -> Result<usize>
fn read_vectored_at( &self, bufs: &mut [IoSliceMut<'_>], offset: u64, ) -> Result<usize>
Like read_at
, except that it reads into a slice of buffers.
Sourcefn read_exact_at(&self, buf: &mut [u8], offset: u64) -> Result<()>
fn read_exact_at(&self, buf: &mut [u8], offset: u64) -> Result<()>
Reads the exact number of bytes required to fill buf
from the given offset.