Trait Parseable

Source
pub trait Parseable<'a> {
    type Error: Error;
    type Output;

    // Required methods
    fn parse(src: &'a str, pos: &mut usize) -> Result<Self::Output, Self::Error>;
    fn name() -> &'a str;

    // Provided methods
    fn skip(src: &'a str, pos: &mut usize) -> Result<(), Self::Error> { ... }
    fn get_parser() -> ParseableParser<'a, Self>
       where Self: Sized { ... }
}

Required Associated Types§

Required Methods§

Source

fn parse(src: &'a str, pos: &mut usize) -> Result<Self::Output, Self::Error>

Source

fn name() -> &'a str

Provided Methods§

Source

fn skip(src: &'a str, pos: &mut usize) -> Result<(), Self::Error>

Source

fn get_parser() -> ParseableParser<'a, Self>
where Self: Sized,

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§