Struct std::io::util::LimitReader[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 unwrap(self) -> R
Consumes the LimitReader, returning the underlying Reader.
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.