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§
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,
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.