pub fn next_line(&mut self) -> Option<io::Result<&[u8]>> {
        if self.pos < self.end_of_complete {
            let lastpos = self.pos;
            self.pos = cmp::min(
                1 + lastpos
                    + memchr(self.delimiter, &self.buf[lastpos..self.end_of_complete])
                        .unwrap_or(self.end_of_complete),
                self.end_of_complete,
            );

            return Some(Ok(&self.buf[lastpos..self.pos]));
        }

        match self.refill() {
            Ok(true) => self.next_line(),
            Ok(false) => {
                if self.end_of_buffer == self.pos {
                    None
                } else {
                    self.pos = self.end_of_buffer;
                    Some(Ok(&self.buf[..self.end_of_buffer]))
                }
            }
            Err(e) => Some(Err(e)),
        }
    }
/// Get the next line from the reader, an IO error, or `None` on EOF.  The delimiter
/// is included in any returned slice, unless the file ends without one or a line was
/// truncated to the buffer size due to length.
///
/// ```no_run
/// # use linereader::LineReader;
/// # use std::fs::File;
/// # use std::io;
/// # fn x() -> io::Result<()> {
/// # let mut reader = LineReader::new(File::open("myfile.txt")?);
/// while let Some(line) = reader.next_line() {
///     let line = line?;  // unwrap io::Result to &[u8]
/// }
/// # Ok(())
/// # }
/// ```
Get the next line from the reader, an IO error, or `None` on EOF.  The delimiter
is included in any returned slice, unless the file ends without one or a line was
truncated to the buffer size due to length.


Get the next line from the reader an IO error or ` None ` on EOF . The delimiter is included in any returned slice unless the file ends without one or a line was truncated to the buffer size due to length .
pub fn next_line(&mut self) -> Option<io::Result<&[u8]>> {
        if self.pos < self.end_of_complete {
            let lastpos = self.pos;
            self.pos = cmp::min(
                1 + lastpos
                    + memchr(self.delimiter, &self.buf[lastpos..self.end_of_complete])
                        .unwrap_or(self.end_of_complete),
                self.end_of_complete,
            );
            return Some(Ok(&self.buf[lastpos..self.pos]));
        }
        match self.refill() {
            Ok(true) => self.next_line(),
            Ok(false) => {
                if self.end_of_buffer == self.pos {
                    None
                } else {
                    self.pos = self.end_of_buffer;
                    Some(Ok(&self.buf[..self.end_of_buffer]))
                }
            }
            Err(e) => Some(Err(e)),
        }
    }
pub fn next_line ( & mut self ) -> Option < io :: Result < & [ u8 ] > > { if self . pos < self . end_of_complete { let lastpos = self . pos ; self . pos = cmp :: min ( 1 + lastpos + memchr ( self . delimiter , & self . buf [ lastpos .. self . end_of_complete ] ) . unwrap_or ( self . end_of_complete ) , self . end_of_complete , ) ; return Some ( Ok ( & self . buf [ lastpos .. self . pos ] ) ) ; } match self . refill ( ) { Ok ( true ) => self . next_line ( ) , Ok ( false ) => { if self . end_of_buffer == self . pos { None } else { self . pos = self . end_of_buffer ; Some ( Ok ( & self . buf [ .. self . end_of_buffer ] ) ) } } Err ( e ) => Some ( Err ( e ) ) , } }
Get the next line from the reader, an IO error, or `None` on EOF.
Get the next line from the reader an IO error or ` None ` on EOF .
&mut self
&mut self
use linereader::linereader;
None
use std::fs::file;
None
use std::io;
None
fn x() -> io::result<()> {
None
let mut reader = linereader::new(file::open("myfile.txt")?);
while let Some(line) = reader.next_line() {
let line = line?;  // unwrap io::Result to &[u8]
}
while let Some ( line ) = reader . next_line () { let line = line? ; // unwrap io :: Result to & [ u8 ] }
ok(())
None
}
None