Struct xdr_codec::record::XdrRecordReader [] [src]

pub struct XdrRecordReader<R: BufRead> {
    // some fields omitted
}

Read records from a bytestream.

Reads will read up to the end of the current fragment, and not beyond. The BufRead trait doesn't otherwise allow for record boundaries to be deliniated. Callers can use the eor method to determine record ends.

Methods

impl<R: BufRead> XdrRecordReader<R>

fn new(rd: R) -> XdrRecordReader<R>

Wrapper a record reader around an existing implementation of BufRead, such as BufReader.

fn eor(&self) -> bool

Current fragment is the end of the record.

Trait Implementations

impl<R: BufRead> Read for XdrRecordReader<R>

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

1.0.0fn read_to_end(&mut self, buf: &mut Vec<u8>) -> Result<usize, Error>

1.0.0fn read_to_string(&mut self, buf: &mut String) -> Result<usize, Error>

1.6.0fn read_exact(&mut self, buf: &mut [u8]) -> Result<(), Error>

1.0.0fn by_ref(&mut self) -> &mut Self

1.0.0fn bytes(self) -> Bytes<Self>

fn chars(self) -> Chars<Self>

1.0.0fn chain<R>(self, next: R) -> Chain<Self, R> where R: Read

1.0.0fn take(self, limit: u64) -> Take<Self>

fn tee<W>(self, out: W) -> Tee<Self, W> where W: Write

impl<R: BufRead> BufRead for XdrRecordReader<R>

fn fill_buf(&mut self) -> Result<&[u8]>

fn consume(&mut self, sz: usize)

1.0.0fn read_until(&mut self, byte: u8, buf: &mut Vec<u8>) -> Result<usize, Error>

1.0.0fn read_line(&mut self, buf: &mut String) -> Result<usize, Error>

1.0.0fn split(self, byte: u8) -> Split<Self>

1.0.0fn lines(self) -> Lines<Self>

impl<R: BufRead> IntoIterator for XdrRecordReader<R>

type Item = Result<Vec<u8>>

type IntoIter = XdrRecordReaderIter<R>

fn into_iter(self) -> Self::IntoIter

Derived Implementations

impl<R: Debug + BufRead> Debug for XdrRecordReader<R>

fn fmt(&self, __arg_0: &mut Formatter) -> Result