[][src]Trait buf_read_ext::BufReadExt

pub trait BufReadExt: BufRead {
    fn stream_until_token<W: Write>(
        &mut self,
        token: &[u8],
        out: &mut W
    ) -> Result<(usize, bool)> { ... } }

Extends any type that implements BufRead with a stream_until_token() function.

Provided methods

fn stream_until_token<W: Write>(
    &mut self,
    token: &[u8],
    out: &mut W
) -> Result<(usize, bool)>

Streams all bytes to out until the token delimiter or EOF is reached.

This function will continue to read (and stream) bytes from the underlying stream until the token or end-of-file is found. Once found, all bytes up to (but not including) the token (if found) will have been streamed to out and the input stream will advance past the token.

This function will return the number of bytes that were streamed to out (this will exclude the count of token bytes, if the token was found), and whether or not the token was found.

Errors

This function will ignore all instances of ErrorKind::Interrupted and will otherwise return any errors returned by fill_buf.

Loading content...

Implementors

impl<T: BufRead> BufReadExt for T[src]

Loading content...