[−][src]Trait syn::synom::Synom
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 Async
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 ExprMacro
impl Synom for ExprGroup
impl Synom for ExprParen
impl Synom for ExprArray
impl Synom for GenericMethodArgument
impl Synom for ExprTuple
impl Synom for ExprIfLet
impl Synom for ExprIf
impl Synom for ExprForLoop
impl Synom for ExprLoop
impl Synom for ExprMatch
impl Synom for ExprCatch
impl Synom for ExprYield
impl Synom for Arm
impl Synom for ExprWhile
impl Synom for ExprWhileLet
impl Synom for Label
impl Synom for ExprContinue
impl Synom for ExprStruct
impl Synom for FieldValue
impl Synom for ExprRepeat
impl Synom for ExprUnsafe
impl Synom for ExprBlock
impl Synom for RangeLimits
impl Synom for ExprPath
impl Synom for Block
impl Synom for Stmt
impl Synom for Pat
impl Synom for PatWild
impl Synom for PatBox
impl Synom for PatIdent
impl Synom for PatTupleStruct
impl Synom for PatStruct
impl Synom for FieldPat
impl Synom for Member
impl Synom for Index
impl Synom for PatPath
impl Synom for PatTuple
impl Synom for PatRef
impl Synom for PatLit
impl Synom for PatRange
impl Synom for PatSlice
impl Synom for PatMacro
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 Item
impl Synom for ItemMacro
impl Synom for ItemMacro2
impl Synom for ItemExternCrate
impl Synom for ItemUse
impl Synom for UseTree
impl Synom for UsePath
impl Synom for UseName
impl Synom for UseRename
impl Synom for UseGlob
impl Synom for UseGroup
impl Synom for ItemStatic
impl Synom for ItemConst
impl Synom for ItemFn
impl Synom for FnArg
impl Synom for ItemMod
impl Synom for ItemForeignMod
impl Synom for ForeignItem
impl Synom for ForeignItemFn
impl Synom for ForeignItemStatic
impl Synom for ForeignItemType
impl Synom for ItemType
impl Synom for ItemStruct
impl Synom for ItemEnum
impl Synom for ItemUnion
impl Synom for ItemTrait
impl Synom for TraitItem
impl Synom for TraitItemConst
impl Synom for TraitItemMethod
impl Synom for TraitItemType
impl Synom for TraitItemMacro
impl Synom for ItemImpl
impl Synom for ImplItem
impl Synom for ImplItemConst
impl Synom for ImplItemMethod
impl Synom for ImplItemType
impl Synom for ImplItemMacro
impl Synom for File
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