Struct io::Pos
[−]
[src]
pub struct Pos<T> { pub pos: usize, // some fields omitted }
Fields
pos: usize
Methods
impl<T> Pos<T>
[src]
Trait Implementations
impl<T> From<T> for Pos<T>
[src]
impl<S: Copy, T: Deref<Target = [S]>> Read<S> for Pos<T>
[src]
type Err = Void
fn read(&mut self, buf: &mut [S]) -> Result<usize, Void>
[src]
r.read(buf) = self.readv(&mut [buf])
fn readv(&mut self, bufs: &mut [&mut [T]]) -> Result<usize, Self::Err>
[src]
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. Read more
fn read_full<E: From<Self::Err> + From<EndOfFile>>(
&mut self,
buf: &mut [T]
) -> Result<(), (E, usize)>
[src]
&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>)
[src]
Return bounds on number of data ready to read. Read more
ⓘImportant traits for Data<R, T>fn data(self) -> Data<Self, T> where
Self: Sized,
[src]
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>
[src]
&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. Read more
ⓘImportant traits for Split<R, T, P, E>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,
[src]
self,
p: P,
keep_delim: bool
) -> Split<Self, T, P, E> where
Self: Sized,
impl<S: Copy, T: DerefMut<Target = [S]>> Write<S> for Pos<T>
[src]
type Err = Void
fn write(&mut self, buf: &[S]) -> Result<usize, Void>
[src]
w.write(buf) = self.writev(&[buf])
fn flush(&mut self) -> Result<(), Void>
[src]
fn writev(&mut self, bufs: &[&[T]]) -> Result<usize, Self::Err>
[src]
Push some data, at most bufs.fold(0, |n, buf| n+buf.len())
, to this sink from given buffers; return how many data were actually written, or a failure. May block if no data can be written when called. Read more
fn write_all(&mut self, buf: &[T]) -> Result<(), (Self::Err, usize)> where
Self::Err: From<EndOfFile>,
[src]
Self::Err: From<EndOfFile>,
Push buf.len()
data to this sink from given buffer; return ()
if so many data were actually written, or a failure and how many data were written before the failure.
impl<T: DerefMut<Target = [u8]>> Write for Pos<T>
[src]
fn write_str(&mut self, s: &str) -> Result
[src]
Writes a slice of bytes into this writer, returning whether the write succeeded. Read more
fn write_char(&mut self, c: char) -> Result<(), Error>
1.1.0[src]
Writes a [char
] into this writer, returning whether the write succeeded. Read more
fn write_fmt(&mut self, args: Arguments) -> Result<(), Error>
1.0.0[src]
Glue for usage of the [write!
] macro with implementors of this trait. Read more