Trait syn::synom::Synom
[−]
[src]
pub trait Synom: Sized { fn parse(input: Cursor) -> PResult<Self>; fn description() -> Option<&'static str> { ... } }
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
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") } }
Implementations on Foreign Types
impl Synom for TokenStream
[src]
impl Synom for TokenStream
impl Synom for TokenTree
[src]
impl Synom for TokenTree
impl Synom for Group
[src]
impl Synom for Group
impl Synom for Punct
[src]
impl Synom for Punct
impl Synom for Literal
[src]
impl Synom for Literal
Implementors
impl Synom for Underscore
impl Synom for Apostrophe
impl Synom for Add
impl Synom for AddEq
impl Synom for And
impl Synom for AndAnd
impl Synom for AndEq
impl Synom for At
impl Synom for Bang
impl Synom for Caret
impl Synom for CaretEq
impl Synom for Colon
impl Synom for Colon2
impl Synom for Comma
impl Synom for Div
impl Synom for DivEq
impl Synom for Dollar
impl Synom for Dot
impl Synom for Dot2
impl Synom for Dot3
impl Synom for DotDotEq
impl Synom for Eq
impl Synom for EqEq
impl Synom for Ge
impl Synom for Gt
impl Synom for Le
impl Synom for Lt
impl Synom for MulEq
impl Synom for Ne
impl Synom for Or
impl Synom for OrEq
impl Synom for OrOr
impl Synom for Pound
impl Synom for Question
impl Synom for RArrow
impl Synom for LArrow
impl Synom for Rem
impl Synom for RemEq
impl Synom for FatArrow
impl Synom for Semi
impl Synom for Shl
impl Synom for ShlEq
impl Synom for Shr
impl Synom for ShrEq
impl Synom for Star
impl Synom for Sub
impl Synom for SubEq
impl Synom for As
impl Synom for Auto
impl Synom for Box
impl Synom for Break
impl Synom for CapSelf
impl Synom for Catch
impl Synom for Const
impl Synom for Continue
impl Synom for Crate
impl Synom for Default
impl Synom for Do
impl Synom for Dyn
impl Synom for Else
impl Synom for Enum
impl Synom for Extern
impl Synom for Fn
impl Synom for For
impl Synom for If
impl Synom for Impl
impl Synom for In
impl Synom for Let
impl Synom for Loop
impl Synom for syn::token::Macro
impl Synom for Match
impl Synom for Mod
impl Synom for Move
impl Synom for Mut
impl Synom for Pub
impl Synom for Ref
impl Synom for Return
impl Synom for Self_
impl Synom for Static
impl Synom for Struct
impl Synom for Super
impl Synom for Trait
impl Synom for syn::token::Type
impl Synom for Union
impl Synom for Unsafe
impl Synom for Use
impl Synom for Where
impl Synom for While
impl Synom for Yield
impl Synom for Variant
impl Synom for FieldsNamed
impl Synom for FieldsUnnamed
impl Synom for Visibility
impl Synom for Expr
impl Synom for ExprLit
impl Synom for ExprParen
impl Synom for ExprPath
impl Synom for Generics
impl Synom for GenericParam
impl Synom for LifetimeDef
impl Synom for BoundLifetimes
impl Synom for TypeParam
impl Synom for TypeParamBound
impl Synom for TraitBound
impl Synom for TraitBoundModifier
impl Synom for ConstParam
impl Synom for WhereClause
impl Synom for WherePredicate
impl Synom for Lifetime
impl Synom for Lit
impl Synom for LitStr
impl Synom for LitByteStr
impl Synom for LitByte
impl Synom for LitChar
impl Synom for LitInt
impl Synom for LitFloat
impl Synom for LitBool
impl Synom for syn::Macro
impl Synom for DeriveInput
impl Synom for UnOp
impl Synom for syn::Type
impl Synom for TypeSlice
impl Synom for TypeArray
impl Synom for TypePtr
impl Synom for TypeReference
impl Synom for TypeBareFn
impl Synom for TypeNever
impl Synom for TypeInfer
impl Synom for TypeTuple
impl Synom for TypeMacro
impl Synom for TypePath
impl Synom for ReturnType
impl Synom for TypeTraitObject
impl Synom for TypeImplTrait
impl Synom for TypeGroup
impl Synom for TypeParen
impl Synom for BareFnArg
impl Synom for BareFnArgName
impl Synom for Abi
impl Synom for Path
impl Synom for GenericArgument
impl Synom for AngleBracketedGenericArguments
impl Synom for ParenthesizedGenericArguments
impl Synom for PathSegment
impl Synom for Binding
impl Synom for Ident