pub trait Build<'a>: Sized {
// Required method
fn build(p: &Parser<'a>, c: Cursor) -> Self;
}
Expand description
This trait allows AST nodes to construct themselves from a single Cursor from the Parser.
AST nodes that implement this should be able to infallably construct themsevles from the given cursor. It’s likely
they’ll need to implement Peek to complete the contract: any AST node returning true
from
Peek should be able to parse the first token, and given this is a single token Node,
Peek effectively demonstrates it can construct itself completely, when true.
Required Methods§
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.