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.

Trait Implementations

impl<R: Reader> Reader for LimitReader<R>

fn read(&mut self, buf: &mut [u8]) -> IoResult<uint>

fn read_at_least(&mut self, min: uint, buf: &mut [u8]) -> IoResult<uint>

fn read_byte(&mut self) -> IoResult<u8>

fn push(&mut self, len: uint, buf: &mut Vec<u8>) -> IoResult<uint>

fn push_at_least(&mut self, min: uint, len: uint, buf: &mut Vec<u8>) -> IoResult<uint>

fn read_exact(&mut self, len: uint) -> IoResult<Vec<u8>>

fn read_to_end(&mut self) -> IoResult<Vec<u8>>

fn read_to_string(&mut self) -> IoResult<String>

fn read_le_uint_n(&mut self, nbytes: uint) -> IoResult<u64>

fn read_le_int_n(&mut self, nbytes: uint) -> IoResult<i64>

fn read_be_uint_n(&mut self, nbytes: uint) -> IoResult<u64>

fn read_be_int_n(&mut self, nbytes: uint) -> IoResult<i64>

fn read_le_uint(&mut self) -> IoResult<uint>

fn read_le_int(&mut self) -> IoResult<int>

fn read_be_uint(&mut self) -> IoResult<uint>

fn read_be_int(&mut self) -> IoResult<int>

fn read_be_u64(&mut self) -> IoResult<u64>

fn read_be_u32(&mut self) -> IoResult<u32>

fn read_be_u16(&mut self) -> IoResult<u16>

fn read_be_i64(&mut self) -> IoResult<i64>

fn read_be_i32(&mut self) -> IoResult<i32>

fn read_be_i16(&mut self) -> IoResult<i16>

fn read_be_f64(&mut self) -> IoResult<f64>

fn read_be_f32(&mut self) -> IoResult<f32>

fn read_le_u64(&mut self) -> IoResult<u64>

fn read_le_u32(&mut self) -> IoResult<u32>

fn read_le_u16(&mut self) -> IoResult<u16>

fn read_le_i64(&mut self) -> IoResult<i64>

fn read_le_i32(&mut self) -> IoResult<i32>

fn read_le_i16(&mut self) -> IoResult<i16>

fn read_le_f64(&mut self) -> IoResult<f64>

fn read_le_f32(&mut self) -> IoResult<f32>

fn read_u8(&mut self) -> IoResult<u8>

fn read_i8(&mut self) -> IoResult<i8>

impl<R: Buffer> Buffer for LimitReader<R>

fn fill_buf<'a>(&'a mut self) -> IoResult<&'a [u8]>

fn consume(&mut self, amt: uint)

fn read_line(&mut self) -> IoResult<String>

fn read_until(&mut self, byte: u8) -> IoResult<Vec<u8>>

fn read_char(&mut self) -> IoResult<char>