pub trait PtxParserwhere
Self: Sized,{
// Required method
fn parse( ) -> impl Fn(&mut PtxTokenStream<'_>) -> Result<(Self, Span), PtxParseError>;
}Expand description
Trait for types that can be parsed from a PTX token stream.
This trait is implemented for all PTX AST node types to enable recursive descent parsing.
Following the combinator architecture, parse() returns a parser function rather than directly taking a stream parameter.
Required Methods§
Sourcefn parse() -> impl Fn(&mut PtxTokenStream<'_>) -> Result<(Self, Span), PtxParseError>
fn parse() -> impl Fn(&mut PtxTokenStream<'_>) -> Result<(Self, Span), PtxParseError>
Returns a parser function that can parse an instance of Self.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".