[−][src]Trait syn::synom::Synom
Parsing interface implemented by all types that can be parsed in a default way from a token stream.
Refer to the module documentation for details about parsing in Syn.
This trait is available if Syn is built with the "parsing"
feature.
Required methods
Loading content...Provided methods
fn description() -> Option<&'static str>
A short name of the type being parsed.
The description should only be used for a simple name. It should not contain newlines or sentence-ending punctuation, to facilitate embedding in larger user-facing strings. Syn will use this description when building error messages about parse failures.
Examples
struct ExprMacro { // ... } impl Synom for ExprMacro { // fn parse(...) -> ... { ... } fn description() -> Option<&'static str> { // Will result in messages like // // "failed to parse macro invocation expression: $reason" Some("macro invocation expression") } }