pub trait Parser {
type Input;
type Output;
// Required method
fn parse(&self, data: &[Self::Input]) -> ParseResult<Self::Output>;
}Expand description
Generic parser trait.
Only Output and parse need to be defined to apply the trait.
Required Associated Types§
Required Methods§
Sourcefn parse(&self, data: &[Self::Input]) -> ParseResult<Self::Output>
fn parse(&self, data: &[Self::Input]) -> ParseResult<Self::Output>
Parse data, and return a ParseResult.