Struct std::io::util::LimitReaderExperimental
[-]
[+]
[src]
pub struct LimitReader<R> { // some fields omitted }
Wraps a Reader
, limiting the number of bytes that can be read from it.
Methods
impl<R: Reader> LimitReader<R>
fn new(r: R, limit: uint) -> LimitReader<R>
Creates a new LimitReader
fn into_inner(self) -> R
Consumes the LimitReader
, returning the underlying Reader
.
fn unwrap(self) -> R
Deprecated, use into_inner() instead
fn limit(&self) -> uint
Returns the number of bytes that can be read before the LimitReader
will return EOF.
Note
The reader may reach EOF after reading fewer bytes than indicated by this method if the underlying reader reaches EOF.