# Parse in syn::parse - Rust
Parsing interface implemented by all types that can be parsed in a default way from a token stream.

syn::parse

# Trait Parse

Source

    pub trait Parse: Sized {
        // Required method
        fn parse(input: ParseStream<'_>) -> Result<Self>;
    }

Expand description

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 implementing and using the `Parse` trait.

## Required Methods§

Source

#### fn parse(input: ParseStream<'_>) -> Result<Self>

## 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.

## Implementations on Foreign Types§

Source §

### impl Parse for TokenTree

Source §

#### fn parse(input: ParseStream<'_>) -> Result<Self>

Source §

### impl Parse for Option<Abi>

Source §

#### fn parse(input: ParseStream<'_>) -> Result<Self>

Source §

### impl Parse for Option<BoundLifetimes>

Source §

#### fn parse(input: ParseStream<'_>) -> Result<Self>

Source §

### impl Parse for Option<Label>

Source §

#### fn parse(input: ParseStream<'_>) -> Result<Self>

Source §

### impl Parse for Option<WhereClause>

Source §

#### fn parse(input: ParseStream<'_>) -> Result<Self>

Source §

### impl Parse for Group

Source §

#### fn parse(input: ParseStream<'_>) -> Result<Self>

Source §

### impl Parse for Literal

Source §

#### fn parse(input: ParseStream<'_>) -> Result<Self>

Source §

### impl Parse for Punct

Source §

#### fn parse(input: ParseStream<'_>) -> Result<Self>

Source §

### impl Parse for TokenStream

Source §

#### fn parse(input: ParseStream<'_>) -> Result<Self>

Source §

### impl<T: Parse + Token> Parse for Option<T>

Source §

#### fn parse(input: ParseStream<'_>) -> Result<Self>

Source §

### impl<T: Parse> Parse for Box<T>

Source §

#### fn parse(input: ParseStream<'_>) -> Result<Self>

## Implementors§

Source §

### impl Parse for BinOp

Source §

### impl Parse for CapturedParam

Source §

### impl Parse for Expr

Source §

### impl Parse for FnArg

Source §

### impl Parse for ForeignItem

Source §

### impl Parse for GenericArgument

Source §

### impl Parse for GenericParam

Source §

### impl Parse for ImplItem

Source §

### impl Parse for Item

Source §

### impl Parse for Lit

Source §

### impl Parse for Member

Source §

### impl Parse for Meta

Source §

### impl Parse for PointerMutability

Source §

### impl Parse for RangeLimits

Source §

### impl Parse for ReturnType

Source §

### impl Parse for StaticMutability

Source §

### impl Parse for Stmt

Source §

### impl Parse for TraitBoundModifier

Source §

### impl Parse for TraitItem

Source §

### impl Parse for syn::Type

Source §

### impl Parse for TypeParamBound

Source §

### impl Parse for UnOp

Source §

### impl Parse for UseTree

Source §

### impl Parse for Visibility

Source §

### impl Parse for WherePredicate

Source §

### impl Parse for Abi

Source §

### impl Parse for AngleBracketedGenericArguments

Source §

### impl Parse for Arm

Source §

### impl Parse for BareFnArg

Source §

### impl Parse for Block

Source §

### impl Parse for BoundLifetimes

Source §

### impl Parse for ConstParam

Source §

### impl Parse for DeriveInput

Source §

### impl Parse for ExprArray

Source §

### impl Parse for ExprAssign

Source §

### impl Parse for ExprAsync

Source §

### impl Parse for ExprAwait

Source §

### impl Parse for ExprBinary

Source §

### impl Parse for ExprBlock

Source §

### impl Parse for ExprBreak

Source §

### impl Parse for ExprCall

Source §

### impl Parse for ExprCast

Source §

### impl Parse for ExprClosure

Source §

### impl Parse for ExprConst

Source §

### impl Parse for ExprContinue

Source §

### impl Parse for ExprField

Source §

### impl Parse for ExprForLoop

Source §

### impl Parse for ExprIf

Source §

### impl Parse for ExprIndex

Source §

### impl Parse for ExprInfer

Source §

### impl Parse for ExprLet

Source §

### impl Parse for ExprLit

Source §

### impl Parse for ExprLoop

Source §

### impl Parse for ExprMacro

Source §

### impl Parse for ExprMatch

Source §

### impl Parse for ExprMethodCall

Source §

### impl Parse for ExprParen

Source §

### impl Parse for ExprPath

Source §

### impl Parse for ExprRange

Source §

### impl Parse for ExprRawAddr

Source §

### impl Parse for ExprReference

Source §

### impl Parse for ExprRepeat

Source §

### impl Parse for ExprReturn

Source §

### impl Parse for ExprStruct

Source §

### impl Parse for ExprTry

Source §

### impl Parse for ExprTryBlock

Source §

### impl Parse for ExprTuple

Source §

### impl Parse for ExprUnary

Source §

### impl Parse for ExprUnsafe

Source §

### impl Parse for ExprWhile

Source §

### impl Parse for ExprYield

Source §

### impl Parse for FieldValue

Source §

### impl Parse for FieldsNamed

Source §

### impl Parse for FieldsUnnamed

Source §

### impl Parse for File

Source §

### impl Parse for ForeignItemFn

Source §

### impl Parse for ForeignItemMacro

Source §

### impl Parse for ForeignItemStatic

Source §

### impl Parse for ForeignItemType

Source §

### impl Parse for Generics

Source §

### impl Parse for Ident

Source §

### impl Parse for ImplItemConst

Source §

### impl Parse for ImplItemFn

Source §

### impl Parse for ImplItemMacro

Source §

### impl Parse for ImplItemType

Source §

### impl Parse for Index

Source §

### impl Parse for ItemConst

Source §

### impl Parse for ItemEnum

Source §

### impl Parse for ItemExternCrate

Source §

### impl Parse for ItemFn

Source §

### impl Parse for ItemForeignMod

Source §

### impl Parse for ItemImpl

Source §

### impl Parse for ItemMacro

Source §

### impl Parse for ItemMod

Source §

### impl Parse for ItemStatic

Source §

### impl Parse for ItemStruct

Source §

### impl Parse for ItemTrait

Source §

### impl Parse for ItemTraitAlias

Source §

### impl Parse for ItemType

Source §

### impl Parse for ItemUnion

Source §

### impl Parse for ItemUse

Source §

### impl Parse for Label

Source §

### impl Parse for Lifetime

Source §

### impl Parse for LifetimeParam

Source §

### impl Parse for LitBool

Source §

### impl Parse for LitByte

Source §

### impl Parse for LitByteStr

Source §

### impl Parse for LitCStr

Source §

### impl Parse for LitChar

Source §

### impl Parse for LitFloat

Source §

### impl Parse for LitInt

Source §

### impl Parse for LitStr

Source §

### impl Parse for syn::Macro

Source §

### impl Parse for MetaList

Source §

### impl Parse for MetaNameValue

Source §

### impl Parse for ParenthesizedGenericArguments

Source §

### impl Parse for PatType

Source §

### impl Parse for Path

Source §

### impl Parse for PathSegment

Source §

### impl Parse for PreciseCapture

Source §

### impl Parse for Receiver

Source §

### impl Parse for Signature

Source §

### impl Parse for TraitBound

Source §

### impl Parse for TraitItemConst

Source §

### impl Parse for TraitItemFn

Source §

### impl Parse for TraitItemMacro

Source §

### impl Parse for TraitItemType

Source §

### impl Parse for TypeArray

Source §

### impl Parse for TypeBareFn

Source §

### impl Parse for TypeGroup

Source §

### impl Parse for TypeImplTrait

Source §

### impl Parse for TypeInfer

Source §

### impl Parse for TypeMacro

Source §

### impl Parse for TypeNever

Source §

### impl Parse for TypeParam

Source §

### impl Parse for TypeParen

Source §

### impl Parse for TypePath

Source §

### impl Parse for TypePtr

Source §

### impl Parse for TypeReference

Source §

### impl Parse for TypeSlice

Source §

### impl Parse for TypeTraitObject

Source §

### impl Parse for TypeTuple

Source §

### impl Parse for Variant

Source §

### impl Parse for WhereClause

Source §

### impl Parse for Abstract

Source §

### impl Parse for And

Source §

### impl Parse for AndAnd

Source §

### impl Parse for AndEq

Source §

### impl Parse for As

Source §

### impl Parse for Async

Source §

### impl Parse for At

Source §

### impl Parse for Auto

Source §

### impl Parse for Await

Source §

### impl Parse for Become

Source §

### impl Parse for syn::token::Box

Source §

### impl Parse for Break

Source §

### impl Parse for Caret

Source §

### impl Parse for CaretEq

Source §

### impl Parse for Colon

Source §

### impl Parse for Comma

Source §

### impl Parse for Const

Source §

### impl Parse for Continue

Source §

### impl Parse for Crate

Source §

### impl Parse for Default

Source §

### impl Parse for Do

Source §

### impl Parse for Dollar

Source §

### impl Parse for Dot

Source §

### impl Parse for DotDot

Source §

### impl Parse for DotDotDot

Source §

### impl Parse for DotDotEq

Source §

### impl Parse for Dyn

Source §

### impl Parse for Else

Source §

### impl Parse for Enum

Source §

### impl Parse for Eq

Source §

### impl Parse for EqEq

Source §

### impl Parse for Extern

Source §

### impl Parse for FatArrow

Source §

### impl Parse for Final

Source §

### impl Parse for Fn

Source §

### impl Parse for For

Source §

### impl Parse for Ge

Source §

### impl Parse for Gt

Source §

### impl Parse for If

Source §

### impl Parse for Impl

Source §

### impl Parse for In

Source §

### impl Parse for LArrow

Source §

### impl Parse for Le

Source §

### impl Parse for Let

Source §

### impl Parse for Loop

Source §

### impl Parse for Lt

Source §

### impl Parse for syn::token::Macro

Source §

### impl Parse for Match

Source §

### impl Parse for Minus

Source §

### impl Parse for MinusEq

Source §

### impl Parse for Mod

Source §

### impl Parse for Move

Source §

### impl Parse for Mut

Source §

### impl Parse for Ne

Source §

### impl Parse for Not

Source §

### impl Parse for Or

Source §

### impl Parse for OrEq

Source §

### impl Parse for OrOr

Source §

### impl Parse for Override

Source §

### impl Parse for PathSep

Source §

### impl Parse for Percent

Source §

### impl Parse for PercentEq

Source §

### impl Parse for Plus

Source §

### impl Parse for PlusEq

Source §

### impl Parse for Pound

Source §

### impl Parse for Priv

Source §

### impl Parse for Pub

Source §

### impl Parse for Question

Source §

### impl Parse for RArrow

Source §

### impl Parse for Raw

Source §

### impl Parse for Ref

Source §

### impl Parse for Return

Source §

### impl Parse for SelfType

Source §

### impl Parse for SelfValue

Source §

### impl Parse for Semi

Source §

### impl Parse for Shl

Source §

### impl Parse for ShlEq

Source §

### impl Parse for Shr

Source §

### impl Parse for ShrEq

Source §

### impl Parse for Slash

Source §

### impl Parse for SlashEq

Source §

### impl Parse for Star

Source §

### impl Parse for StarEq

Source §

### impl Parse for Static

Source §

### impl Parse for Struct

Source §

### impl Parse for Super

Source §

### impl Parse for Tilde

Source §

### impl Parse for Trait

Source §

### impl Parse for Try

Source §

### impl Parse for syn::token::Type

Source §

### impl Parse for Typeof

Source §

### impl Parse for Underscore

Source §

### impl Parse for Union

Source §

### impl Parse for Unsafe

Source §

### impl Parse for Unsized

Source §

### impl Parse for Use

Source §

### impl Parse for Virtual

Source §

### impl Parse for Where

Source §

### impl Parse for While

Source §

### impl Parse for Yield

Source §

### impl Parse for Nothing