[][src]Trait needletail::formats::RecParser

pub trait RecParser<'s>: Sized + Iterator {
    type Header;
    fn from_buffer(buf: &'s [u8], last: bool) -> Self;
fn header(&mut self) -> Result<Self::Header, ParseError>;
fn eof(&self) -> Result<(), ParseError>;
fn used(&self) -> usize; }

[⚠️Unstable] RecParser is an adaptor trait that allows new file format parsers to be defined. It takes a chunk from a RecBuffer (from_reader), optionally parses an initial header out (header) and then provides an iterator interface to parse a record stream. When finished, it provides an eof function to determine if the stream is completely exhausted.

Associated Types

type Header

Loading content...

Required methods

fn from_buffer(buf: &'s [u8], last: bool) -> Self

fn header(&mut self) -> Result<Self::Header, ParseError>

fn eof(&self) -> Result<(), ParseError>

fn used(&self) -> usize

Loading content...

Implementors

impl<'a> RecParser<'a> for FastaParser<'a>[src]

type Header = ()

impl<'a> RecParser<'a> for FastqParser<'a>[src]

type Header = ()

Loading content...