pub trait Parsable<C: Context>: Sized {
// Provided methods
fn parse_symbol(_name: Box<str>, _context: &C) -> Result<Self> { ... }
fn parse_list(_parser: &mut Parser, _context: &C) -> Result<Self> { ... }
}
Expand description
This trait needs to be implemented for every struct which can be parsed using the token parser.
Provided Methods§
Sourcefn parse_symbol(_name: Box<str>, _context: &C) -> Result<Self>
fn parse_symbol(_name: Box<str>, _context: &C) -> Result<Self>
When a symbol is found by the parser, this will be called.
Sourcefn parse_list(_parser: &mut Parser, _context: &C) -> Result<Self>
fn parse_list(_parser: &mut Parser, _context: &C) -> Result<Self>
When a subparser is found by the parser, this will be called.
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.