[−][src]Trait io_ranges::ReadAt
A trait for reading from files.
Unlike std::io::Read
, ReadAt
's functions take a &self
rather than a
&mut self
, since they don't have a current position to mutate.
Required methods
fn read_at(&self, buf: &mut [u8], offset: u64) -> Result<usize>
[src]
Reads a number of bytes starting from a given offset.
This is similar to std::os::unix::fs::FileExt::read_at
, except it
takes self
by immutable reference since the entire side effect is
I/O, and it's supported on non-Unix platforms including Windows.
fn read_exact_at(&self, buf: &mut [u8], offset: u64) -> Result<()>
[src]
Reads the exact number of byte required to fill buf from the given offset.
This is similar to std::os::unix::fs::FileExt::read_exact_at
, except
it takes self
by immutable reference since the entire side effect is
I/O, and it's supported on non-Unix platforms including Windows.
fn read_vectored_at(
&self,
bufs: &mut [IoSliceMut<'_>],
offset: u64
) -> Result<usize>
[src]
&self,
bufs: &mut [IoSliceMut<'_>],
offset: u64
) -> Result<usize>
Is to read_vectored
what read_at
is to read
.
fn read_exact_vectored_at(
&self,
bufs: &mut [IoSliceMut<'_>],
offset: u64
) -> Result<()>
[src]
&self,
bufs: &mut [IoSliceMut<'_>],
offset: u64
) -> Result<()>
Is to read_exact_vectored
what read_exact_at
is to read_exact
.
fn is_read_vectored_at(&self) -> bool
[src]
Determines if Self
has an efficient read_vectored_at
implementation.
Implementations on Foreign Types
impl ReadAt for File
[src]
fn read_at(&self, buf: &mut [u8], offset: u64) -> Result<usize>
[src]
fn read_exact_at(&self, buf: &mut [u8], offset: u64) -> Result<()>
[src]
fn read_vectored_at(
&self,
bufs: &mut [IoSliceMut<'_>],
offset: u64
) -> Result<usize>
[src]
&self,
bufs: &mut [IoSliceMut<'_>],
offset: u64
) -> Result<usize>
fn read_exact_vectored_at(
&self,
bufs: &mut [IoSliceMut<'_>],
offset: u64
) -> Result<()>
[src]
&self,
bufs: &mut [IoSliceMut<'_>],
offset: u64
) -> Result<()>
fn is_read_vectored_at(&self) -> bool
[src]
impl ReadAt for [u8]
[src]
fn read_at(&self, buf: &mut [u8], offset: u64) -> Result<usize>
[src]
fn read_exact_at(&self, buf: &mut [u8], offset: u64) -> Result<()>
[src]
fn read_vectored_at(
&self,
bufs: &mut [IoSliceMut<'_>],
offset: u64
) -> Result<usize>
[src]
&self,
bufs: &mut [IoSliceMut<'_>],
offset: u64
) -> Result<usize>
fn read_exact_vectored_at(
&self,
bufs: &mut [IoSliceMut<'_>],
offset: u64
) -> Result<()>
[src]
&self,
bufs: &mut [IoSliceMut<'_>],
offset: u64
) -> Result<()>
fn is_read_vectored_at(&self) -> bool
[src]
impl ReadAt for Vec<u8>
[src]
fn read_at(&self, buf: &mut [u8], offset: u64) -> Result<usize>
[src]
fn read_exact_at(&self, buf: &mut [u8], offset: u64) -> Result<()>
[src]
fn read_vectored_at(
&self,
bufs: &mut [IoSliceMut<'_>],
offset: u64
) -> Result<usize>
[src]
&self,
bufs: &mut [IoSliceMut<'_>],
offset: u64
) -> Result<usize>
fn read_exact_vectored_at(
&self,
bufs: &mut [IoSliceMut<'_>],
offset: u64
) -> Result<()>
[src]
&self,
bufs: &mut [IoSliceMut<'_>],
offset: u64
) -> Result<()>
fn is_read_vectored_at(&self) -> bool
[src]
Implementors
impl ReadAt for FileEditor
[src]
fn read_at(&self, buf: &mut [u8], offset: u64) -> Result<usize>
[src]
fn read_exact_at(&self, buf: &mut [u8], offset: u64) -> Result<()>
[src]
fn read_vectored_at(
&self,
bufs: &mut [IoSliceMut<'_>],
offset: u64
) -> Result<usize>
[src]
&self,
bufs: &mut [IoSliceMut<'_>],
offset: u64
) -> Result<usize>
fn read_exact_vectored_at(
&self,
bufs: &mut [IoSliceMut<'_>],
offset: u64
) -> Result<()>
[src]
&self,
bufs: &mut [IoSliceMut<'_>],
offset: u64
) -> Result<()>
fn is_read_vectored_at(&self) -> bool
[src]
impl ReadAt for FileReader
[src]
fn read_at(&self, buf: &mut [u8], offset: u64) -> Result<usize>
[src]
fn read_exact_at(&self, buf: &mut [u8], offset: u64) -> Result<()>
[src]
fn read_vectored_at(
&self,
bufs: &mut [IoSliceMut<'_>],
offset: u64
) -> Result<usize>
[src]
&self,
bufs: &mut [IoSliceMut<'_>],
offset: u64
) -> Result<usize>
fn read_exact_vectored_at(
&self,
bufs: &mut [IoSliceMut<'_>],
offset: u64
) -> Result<()>
[src]
&self,
bufs: &mut [IoSliceMut<'_>],
offset: u64
) -> Result<()>