Lines Matching defs:Parse
16 //! enums (not shown) and structs, then provide implementations of the [`Parse`]
19 //! Once `Parse` impls have been defined, they can be called conveniently from a
32 //! use syn::parse::{Parse, ParseStream};
49 //! impl Parse for Item {
62 //! impl Parse for ItemStruct {
74 //! # impl Parse for ItemEnum {
96 //! implements the [`Parse`] trait, which includes most types in Syn.
128 //! The `Parse` trait is not implemented in these cases because there is no good
148 //! single `Parse` implementation, and those parser functions can be invoked
161 //! // Parse a nonempty sequence of path segments separated by `::` punctuation
167 //! // Parse a possibly empty sequence of expressions terminated by commas with
173 //! // Parse zero or more outer attributes but not inner attributes.
210 /// the `Parse` trait.
213 pub trait Parse: Sized {
460 pub fn parse<T: Parse>(&self) -> Result<T> {
476 /// use syn::parse::{Parse, ParseStream};
489 /// impl Parse for UnitStruct {
528 /// use syn::parse::{Parse, ParseStream};
543 /// impl Parse for MarkerTrait {
595 /// use syn::parse::{Parse, ParseStream};
605 /// impl Parse for UnionOrMacro {
660 /// use syn::parse::{Parse, ParseStream};
663 /// // Parse a simplified tuple struct syntax like:
674 /// impl Parse for TupleStruct {
705 /// use syn::parse::{Parse, ParseStream};
714 /// impl Parse for Fin {
724 /// impl Parse for Thing {
746 P::Token: Parse,
761 /// use syn::parse::{Parse, ParseStream};
771 /// impl Parse for Mod {
800 /// use syn::parse::{Parse, ParseStream};
819 /// impl Parse for GenericParam {
911 /// use syn::parse::{Parse, ParseStream};
924 /// impl Parse for PubVisibility {
981 /// use syn::parse::{Parse, ParseStream};
988 /// impl Parse for Loop {
1010 /// This is a powerful low-level API used for defining the `Parse` impls of
1136 /// use syn::parse::{Parse, Parser};
1139 /// // Parse syn::Type as a TokenStream, surrounded by angle brackets.
1164 impl<T: Parse> Parse for Box<T> {
1171 impl<T: Parse + Token> Parse for Option<T> {
1182 impl Parse for TokenStream {
1189 impl Parse for TokenTree {
1199 impl Parse for Group {
1213 impl Parse for Punct {
1223 impl Parse for Literal {
1240 /// Parse a proc-macro2 token stream into the chosen syntax tree node.
1246 /// Parse tokens of source code into the chosen syntax tree node.
1256 /// Parse a string of Rust code into the chosen syntax tree node.
1356 impl Parse for Nothing {