[−][src]Trait io::Read
Associated Types
type Err
Provided methods
fn read(&mut self, buf: &mut [T]) -> Result<usize, Self::Err>
r.read(buf) = self.readv(&mut [buf])
fn readv(&mut self, bufs: &mut [&mut [T]]) -> Result<usize, Self::Err>
Pull some data, at most bufs.fold(0, |n, buf| n+buf.len())
, from this source into given buffers; return how many data were actually read, or a failure.
May block if no data can be read when called.
If this returns 0 data read, the possibilities are these:
bufs.all(|buf| buf.len() == 0)
- The reader reached some end, and can unlikely produce further bytes, at least temporarily.
fn try_read_full(&mut self, buf: &mut [T]) -> Result<usize, (Self::Err, usize)>
Pull buf.len()
data from this source into given buffer; return how many data were
actually read (which may be less than buf.len()
if we reached end-of-file), or a
failure and how many data were read before the failure.
fn read_full<E: From<Self::Err> + From<EndOfFile>>(
&mut self,
buf: &mut [T]
) -> Result<(), (E, usize)>
&mut self,
buf: &mut [T]
) -> Result<(), (E, usize)>
Pull buf.len()
data from this source into given buffer; return ()
if so many data were actually read, or a failure and how many data were read before the failure.
fn size_hint(&self) -> (usize, Option<usize>)
Return bounds on number of data ready to read.
The default returns (0 None)
which is never wrong.
fn data(self) -> Data<Self, T>ⓘ where
Self: Sized,
Self: Sized,
Make an Iterator
over the data of this reader.
fn read_onto_vec<A: Alloc>(
&mut self,
xs: &mut Vec<T, A>
) -> Result<usize, Self::Err>
&mut self,
xs: &mut Vec<T, A>
) -> Result<usize, Self::Err>
Pull data from this source into the spare storage of xs
, and modify its length to include the data read.
If this fails, xs
is unmodified.
fn split<P: FnMut(T) -> bool, E: From<Self::Err> + From<NoMemory>>(
self,
p: P,
keep_delim: bool
) -> Split<Self, T, P, E>ⓘ where
Self: Sized,
self,
p: P,
keep_delim: bool
) -> Split<Self, T, P, E>ⓘ where
Self: Sized,
Implementors
impl<'a, T: Copy, R: ?Sized + DerefMut> Read<T> for R where
R::Target: Read<T>,
[src]
R::Target: Read<T>,