//! Generated file, do not edit by hand, see `xtask/src/codegen` use crate::{ ast::{self, support, AstChildren, AstNode}, SyntaxKind::{self, *}, SyntaxNode, SyntaxToken, T, }; #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct Name { pub(crate) syntax: SyntaxNode, } impl Name { pub fn ident_token(&self) -> Option { support::token(&self.syntax, T![ident]) } pub fn self_token(&self) -> Option { support::token(&self.syntax, T![self]) } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct NameRef { pub(crate) syntax: SyntaxNode, } impl NameRef { pub fn ident_token(&self) -> Option { support::token(&self.syntax, T![ident]) } pub fn self_token(&self) -> Option { support::token(&self.syntax, T![self]) } pub fn super_token(&self) -> Option { support::token(&self.syntax, T![super]) } pub fn crate_token(&self) -> Option { support::token(&self.syntax, T![crate]) } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct Lifetime { pub(crate) syntax: SyntaxNode, } impl Lifetime { pub fn lifetime_ident_token(&self) -> Option { support::token(&self.syntax, T![lifetime_ident]) } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct Path { pub(crate) syntax: SyntaxNode, } impl Path { pub fn qualifier(&self) -> Option { support::child(&self.syntax) } pub fn coloncolon_token(&self) -> Option { support::token(&self.syntax, T![::]) } pub fn segment(&self) -> Option { support::child(&self.syntax) } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct PathSegment { pub(crate) syntax: SyntaxNode, } impl PathSegment { pub fn coloncolon_token(&self) -> Option { support::token(&self.syntax, T![::]) } pub fn name_ref(&self) -> Option { support::child(&self.syntax) } pub fn generic_arg_list(&self) -> Option { support::child(&self.syntax) } pub fn param_list(&self) -> Option { support::child(&self.syntax) } pub fn ret_type(&self) -> Option { support::child(&self.syntax) } pub fn l_angle_token(&self) -> Option { support::token(&self.syntax, T![<]) } pub fn path_type(&self) -> Option { support::child(&self.syntax) } pub fn as_token(&self) -> Option { support::token(&self.syntax, T![as]) } pub fn r_angle_token(&self) -> Option { support::token(&self.syntax, T![>]) } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct GenericArgList { pub(crate) syntax: SyntaxNode, } impl GenericArgList { pub fn coloncolon_token(&self) -> Option { support::token(&self.syntax, T![::]) } pub fn l_angle_token(&self) -> Option { support::token(&self.syntax, T![<]) } pub fn generic_args(&self) -> AstChildren { support::children(&self.syntax) } pub fn r_angle_token(&self) -> Option { support::token(&self.syntax, T![>]) } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct ParamList { pub(crate) syntax: SyntaxNode, } impl ParamList { pub fn l_paren_token(&self) -> Option { support::token(&self.syntax, T!['(']) } pub fn self_param(&self) -> Option { support::child(&self.syntax) } pub fn comma_token(&self) -> Option { support::token(&self.syntax, T![,]) } pub fn params(&self) -> AstChildren { support::children(&self.syntax) } pub fn r_paren_token(&self) -> Option { support::token(&self.syntax, T![')']) } pub fn pipe_token(&self) -> Option { support::token(&self.syntax, T![|]) } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct RetType { pub(crate) syntax: SyntaxNode, } impl RetType { pub fn thin_arrow_token(&self) -> Option { support::token(&self.syntax, T![->]) } pub fn ty(&self) -> Option { support::child(&self.syntax) } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct PathType { pub(crate) syntax: SyntaxNode, } impl PathType { pub fn path(&self) -> Option { support::child(&self.syntax) } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct TypeArg { pub(crate) syntax: SyntaxNode, } impl TypeArg { pub fn ty(&self) -> Option { support::child(&self.syntax) } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct AssocTypeArg { pub(crate) syntax: SyntaxNode, } impl ast::TypeBoundsOwner for AssocTypeArg {} impl AssocTypeArg { pub fn name_ref(&self) -> Option { support::child(&self.syntax) } pub fn eq_token(&self) -> Option { support::token(&self.syntax, T![=]) } pub fn ty(&self) -> Option { support::child(&self.syntax) } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct LifetimeArg { pub(crate) syntax: SyntaxNode, } impl LifetimeArg { pub fn lifetime(&self) -> Option { support::child(&self.syntax) } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct ConstArg { pub(crate) syntax: SyntaxNode, } impl ConstArg { pub fn expr(&self) -> Option { support::child(&self.syntax) } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct TypeBoundList { pub(crate) syntax: SyntaxNode, } impl TypeBoundList { pub fn bounds(&self) -> AstChildren { support::children(&self.syntax) } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct MacroCall { pub(crate) syntax: SyntaxNode, } impl ast::AttrsOwner for MacroCall {} impl MacroCall { pub fn path(&self) -> Option { support::child(&self.syntax) } pub fn excl_token(&self) -> Option { support::token(&self.syntax, T![!]) } pub fn token_tree(&self) -> Option { support::child(&self.syntax) } pub fn semicolon_token(&self) -> Option { support::token(&self.syntax, T![;]) } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct Attr { pub(crate) syntax: SyntaxNode, } impl Attr { pub fn pound_token(&self) -> Option { support::token(&self.syntax, T![#]) } pub fn excl_token(&self) -> Option { support::token(&self.syntax, T![!]) } pub fn l_brack_token(&self) -> Option { support::token(&self.syntax, T!['[']) } pub fn path(&self) -> Option { support::child(&self.syntax) } pub fn eq_token(&self) -> Option { support::token(&self.syntax, T![=]) } pub fn literal(&self) -> Option { support::child(&self.syntax) } pub fn token_tree(&self) -> Option { support::child(&self.syntax) } pub fn r_brack_token(&self) -> Option { support::token(&self.syntax, T![']']) } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct TokenTree { pub(crate) syntax: SyntaxNode, } impl TokenTree { pub fn l_paren_token(&self) -> Option { support::token(&self.syntax, T!['(']) } pub fn r_paren_token(&self) -> Option { support::token(&self.syntax, T![')']) } pub fn l_curly_token(&self) -> Option { support::token(&self.syntax, T!['{']) } pub fn r_curly_token(&self) -> Option { support::token(&self.syntax, T!['}']) } pub fn l_brack_token(&self) -> Option { support::token(&self.syntax, T!['[']) } pub fn r_brack_token(&self) -> Option { support::token(&self.syntax, T![']']) } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct MacroItems { pub(crate) syntax: SyntaxNode, } impl ast::ModuleItemOwner for MacroItems {} impl MacroItems {} #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct MacroStmts { pub(crate) syntax: SyntaxNode, } impl MacroStmts { pub fn statements(&self) -> AstChildren { support::children(&self.syntax) } pub fn expr(&self) -> Option { support::child(&self.syntax) } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct SourceFile { pub(crate) syntax: SyntaxNode, } impl ast::AttrsOwner for SourceFile {} impl ast::ModuleItemOwner for SourceFile {} impl SourceFile { pub fn shebang_token(&self) -> Option { support::token(&self.syntax, T![shebang]) } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct Const { pub(crate) syntax: SyntaxNode, } impl ast::AttrsOwner for Const {} impl ast::NameOwner for Const {} impl ast::VisibilityOwner for Const {} impl Const { pub fn default_token(&self) -> Option { support::token(&self.syntax, T![default]) } pub fn const_token(&self) -> Option { support::token(&self.syntax, T![const]) } pub fn underscore_token(&self) -> Option { support::token(&self.syntax, T![_]) } pub fn colon_token(&self) -> Option { support::token(&self.syntax, T![:]) } pub fn ty(&self) -> Option { support::child(&self.syntax) } pub fn eq_token(&self) -> Option { support::token(&self.syntax, T![=]) } pub fn body(&self) -> Option { support::child(&self.syntax) } pub fn semicolon_token(&self) -> Option { support::token(&self.syntax, T![;]) } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct Enum { pub(crate) syntax: SyntaxNode, } impl ast::AttrsOwner for Enum {} impl ast::NameOwner for Enum {} impl ast::VisibilityOwner for Enum {} impl ast::GenericParamsOwner for Enum {} impl Enum { pub fn enum_token(&self) -> Option { support::token(&self.syntax, T![enum]) } pub fn variant_list(&self) -> Option { support::child(&self.syntax) } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct ExternBlock { pub(crate) syntax: SyntaxNode, } impl ast::AttrsOwner for ExternBlock {} impl ExternBlock { pub fn abi(&self) -> Option { support::child(&self.syntax) } pub fn extern_item_list(&self) -> Option { support::child(&self.syntax) } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct ExternCrate { pub(crate) syntax: SyntaxNode, } impl ast::AttrsOwner for ExternCrate {} impl ast::VisibilityOwner for ExternCrate {} impl ExternCrate { pub fn extern_token(&self) -> Option { support::token(&self.syntax, T![extern]) } pub fn crate_token(&self) -> Option { support::token(&self.syntax, T![crate]) } pub fn name_ref(&self) -> Option { support::child(&self.syntax) } pub fn rename(&self) -> Option { support::child(&self.syntax) } pub fn semicolon_token(&self) -> Option { support::token(&self.syntax, T![;]) } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct Fn { pub(crate) syntax: SyntaxNode, } impl ast::AttrsOwner for Fn {} impl ast::NameOwner for Fn {} impl ast::VisibilityOwner for Fn {} impl ast::GenericParamsOwner for Fn {} impl Fn { pub fn default_token(&self) -> Option { support::token(&self.syntax, T![default]) } pub fn const_token(&self) -> Option { support::token(&self.syntax, T![const]) } pub fn async_token(&self) -> Option { support::token(&self.syntax, T![async]) } pub fn unsafe_token(&self) -> Option { support::token(&self.syntax, T![unsafe]) } pub fn abi(&self) -> Option { support::child(&self.syntax) } pub fn fn_token(&self) -> Option { support::token(&self.syntax, T![fn]) } pub fn param_list(&self) -> Option { support::child(&self.syntax) } pub fn ret_type(&self) -> Option { support::child(&self.syntax) } pub fn body(&self) -> Option { support::child(&self.syntax) } pub fn semicolon_token(&self) -> Option { support::token(&self.syntax, T![;]) } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct Impl { pub(crate) syntax: SyntaxNode, } impl ast::AttrsOwner for Impl {} impl ast::VisibilityOwner for Impl {} impl ast::GenericParamsOwner for Impl {} impl Impl { pub fn default_token(&self) -> Option { support::token(&self.syntax, T![default]) } pub fn unsafe_token(&self) -> Option { support::token(&self.syntax, T![unsafe]) } pub fn impl_token(&self) -> Option { support::token(&self.syntax, T![impl]) } pub fn const_token(&self) -> Option { support::token(&self.syntax, T![const]) } pub fn excl_token(&self) -> Option { support::token(&self.syntax, T![!]) } pub fn for_token(&self) -> Option { support::token(&self.syntax, T![for]) } pub fn assoc_item_list(&self) -> Option { support::child(&self.syntax) } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct MacroRules { pub(crate) syntax: SyntaxNode, } impl ast::AttrsOwner for MacroRules {} impl ast::NameOwner for MacroRules {} impl ast::VisibilityOwner for MacroRules {} impl MacroRules { pub fn macro_rules_token(&self) -> Option { support::token(&self.syntax, T![macro_rules]) } pub fn excl_token(&self) -> Option { support::token(&self.syntax, T![!]) } pub fn token_tree(&self) -> Option { support::child(&self.syntax) } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct MacroDef { pub(crate) syntax: SyntaxNode, } impl ast::AttrsOwner for MacroDef {} impl ast::NameOwner for MacroDef {} impl ast::VisibilityOwner for MacroDef {} impl MacroDef { pub fn macro_token(&self) -> Option { support::token(&self.syntax, T![macro]) } pub fn args(&self) -> Option { support::child(&self.syntax) } pub fn body(&self) -> Option { support::child(&self.syntax) } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct Module { pub(crate) syntax: SyntaxNode, } impl ast::AttrsOwner for Module {} impl ast::NameOwner for Module {} impl ast::VisibilityOwner for Module {} impl Module { pub fn mod_token(&self) -> Option { support::token(&self.syntax, T![mod]) } pub fn item_list(&self) -> Option { support::child(&self.syntax) } pub fn semicolon_token(&self) -> Option { support::token(&self.syntax, T![;]) } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct Static { pub(crate) syntax: SyntaxNode, } impl ast::AttrsOwner for Static {} impl ast::NameOwner for Static {} impl ast::VisibilityOwner for Static {} impl Static { pub fn static_token(&self) -> Option { support::token(&self.syntax, T![static]) } pub fn mut_token(&self) -> Option { support::token(&self.syntax, T![mut]) } pub fn colon_token(&self) -> Option { support::token(&self.syntax, T![:]) } pub fn ty(&self) -> Option { support::child(&self.syntax) } pub fn eq_token(&self) -> Option { support::token(&self.syntax, T![=]) } pub fn body(&self) -> Option { support::child(&self.syntax) } pub fn semicolon_token(&self) -> Option { support::token(&self.syntax, T![;]) } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct Struct { pub(crate) syntax: SyntaxNode, } impl ast::AttrsOwner for Struct {} impl ast::NameOwner for Struct {} impl ast::VisibilityOwner for Struct {} impl ast::GenericParamsOwner for Struct {} impl Struct { pub fn struct_token(&self) -> Option { support::token(&self.syntax, T![struct]) } pub fn semicolon_token(&self) -> Option { support::token(&self.syntax, T![;]) } pub fn field_list(&self) -> Option { support::child(&self.syntax) } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct Trait { pub(crate) syntax: SyntaxNode, } impl ast::AttrsOwner for Trait {} impl ast::NameOwner for Trait {} impl ast::VisibilityOwner for Trait {} impl ast::GenericParamsOwner for Trait {} impl ast::TypeBoundsOwner for Trait {} impl Trait { pub fn unsafe_token(&self) -> Option { support::token(&self.syntax, T![unsafe]) } pub fn auto_token(&self) -> Option { support::token(&self.syntax, T![auto]) } pub fn trait_token(&self) -> Option { support::token(&self.syntax, T![trait]) } pub fn assoc_item_list(&self) -> Option { support::child(&self.syntax) } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct TypeAlias { pub(crate) syntax: SyntaxNode, } impl ast::AttrsOwner for TypeAlias {} impl ast::NameOwner for TypeAlias {} impl ast::VisibilityOwner for TypeAlias {} impl ast::GenericParamsOwner for TypeAlias {} impl ast::TypeBoundsOwner for TypeAlias {} impl TypeAlias { pub fn default_token(&self) -> Option { support::token(&self.syntax, T![default]) } pub fn type_token(&self) -> Option { support::token(&self.syntax, T![type]) } pub fn eq_token(&self) -> Option { support::token(&self.syntax, T![=]) } pub fn ty(&self) -> Option { support::child(&self.syntax) } pub fn semicolon_token(&self) -> Option { support::token(&self.syntax, T![;]) } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct Union { pub(crate) syntax: SyntaxNode, } impl ast::AttrsOwner for Union {} impl ast::NameOwner for Union {} impl ast::VisibilityOwner for Union {} impl ast::GenericParamsOwner for Union {} impl Union { pub fn union_token(&self) -> Option { support::token(&self.syntax, T![union]) } pub fn record_field_list(&self) -> Option { support::child(&self.syntax) } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct Use { pub(crate) syntax: SyntaxNode, } impl ast::AttrsOwner for Use {} impl ast::VisibilityOwner for Use {} impl Use { pub fn use_token(&self) -> Option { support::token(&self.syntax, T![use]) } pub fn use_tree(&self) -> Option { support::child(&self.syntax) } pub fn semicolon_token(&self) -> Option { support::token(&self.syntax, T![;]) } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct Visibility { pub(crate) syntax: SyntaxNode, } impl Visibility { pub fn pub_token(&self) -> Option { support::token(&self.syntax, T![pub]) } pub fn l_paren_token(&self) -> Option { support::token(&self.syntax, T!['(']) } pub fn in_token(&self) -> Option { support::token(&self.syntax, T![in]) } pub fn path(&self) -> Option { support::child(&self.syntax) } pub fn r_paren_token(&self) -> Option { support::token(&self.syntax, T![')']) } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct ItemList { pub(crate) syntax: SyntaxNode, } impl ast::AttrsOwner for ItemList {} impl ast::ModuleItemOwner for ItemList {} impl ItemList { pub fn l_curly_token(&self) -> Option { support::token(&self.syntax, T!['{']) } pub fn r_curly_token(&self) -> Option { support::token(&self.syntax, T!['}']) } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct Rename { pub(crate) syntax: SyntaxNode, } impl ast::NameOwner for Rename {} impl Rename { pub fn as_token(&self) -> Option { support::token(&self.syntax, T![as]) } pub fn underscore_token(&self) -> Option { support::token(&self.syntax, T![_]) } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct UseTree { pub(crate) syntax: SyntaxNode, } impl UseTree { pub fn path(&self) -> Option { support::child(&self.syntax) } pub fn coloncolon_token(&self) -> Option { support::token(&self.syntax, T![::]) } pub fn star_token(&self) -> Option { support::token(&self.syntax, T![*]) } pub fn use_tree_list(&self) -> Option { support::child(&self.syntax) } pub fn rename(&self) -> Option { support::child(&self.syntax) } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct UseTreeList { pub(crate) syntax: SyntaxNode, } impl UseTreeList { pub fn l_curly_token(&self) -> Option { support::token(&self.syntax, T!['{']) } pub fn use_trees(&self) -> AstChildren { support::children(&self.syntax) } pub fn r_curly_token(&self) -> Option { support::token(&self.syntax, T!['}']) } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct Abi { pub(crate) syntax: SyntaxNode, } impl Abi { pub fn extern_token(&self) -> Option { support::token(&self.syntax, T![extern]) } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct GenericParamList { pub(crate) syntax: SyntaxNode, } impl GenericParamList { pub fn l_angle_token(&self) -> Option { support::token(&self.syntax, T![<]) } pub fn generic_params(&self) -> AstChildren { support::children(&self.syntax) } pub fn r_angle_token(&self) -> Option { support::token(&self.syntax, T![>]) } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct WhereClause { pub(crate) syntax: SyntaxNode, } impl WhereClause { pub fn where_token(&self) -> Option { support::token(&self.syntax, T![where]) } pub fn predicates(&self) -> AstChildren { support::children(&self.syntax) } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct BlockExpr { pub(crate) syntax: SyntaxNode, } impl ast::AttrsOwner for BlockExpr {} impl BlockExpr { pub fn l_curly_token(&self) -> Option { support::token(&self.syntax, T!['{']) } pub fn statements(&self) -> AstChildren { support::children(&self.syntax) } pub fn tail_expr(&self) -> Option { support::child(&self.syntax) } pub fn r_curly_token(&self) -> Option { support::token(&self.syntax, T!['}']) } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct SelfParam { pub(crate) syntax: SyntaxNode, } impl ast::AttrsOwner for SelfParam {} impl ast::NameOwner for SelfParam {} impl SelfParam { pub fn amp_token(&self) -> Option { support::token(&self.syntax, T![&]) } pub fn lifetime(&self) -> Option { support::child(&self.syntax) } pub fn mut_token(&self) -> Option { support::token(&self.syntax, T![mut]) } pub fn colon_token(&self) -> Option { support::token(&self.syntax, T![:]) } pub fn ty(&self) -> Option { support::child(&self.syntax) } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct Param { pub(crate) syntax: SyntaxNode, } impl ast::AttrsOwner for Param {} impl Param { pub fn pat(&self) -> Option { support::child(&self.syntax) } pub fn colon_token(&self) -> Option { support::token(&self.syntax, T![:]) } pub fn ty(&self) -> Option { support::child(&self.syntax) } pub fn dotdotdot_token(&self) -> Option { support::token(&self.syntax, T![...]) } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct RecordFieldList { pub(crate) syntax: SyntaxNode, } impl RecordFieldList { pub fn l_curly_token(&self) -> Option { support::token(&self.syntax, T!['{']) } pub fn fields(&self) -> AstChildren { support::children(&self.syntax) } pub fn r_curly_token(&self) -> Option { support::token(&self.syntax, T!['}']) } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct TupleFieldList { pub(crate) syntax: SyntaxNode, } impl TupleFieldList { pub fn l_paren_token(&self) -> Option { support::token(&self.syntax, T!['(']) } pub fn fields(&self) -> AstChildren { support::children(&self.syntax) } pub fn r_paren_token(&self) -> Option { support::token(&self.syntax, T![')']) } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct RecordField { pub(crate) syntax: SyntaxNode, } impl ast::AttrsOwner for RecordField {} impl ast::NameOwner for RecordField {} impl ast::VisibilityOwner for RecordField {} impl RecordField { pub fn colon_token(&self) -> Option { support::token(&self.syntax, T![:]) } pub fn ty(&self) -> Option { support::child(&self.syntax) } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct TupleField { pub(crate) syntax: SyntaxNode, } impl ast::AttrsOwner for TupleField {} impl ast::VisibilityOwner for TupleField {} impl TupleField { pub fn ty(&self) -> Option { support::child(&self.syntax) } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct VariantList { pub(crate) syntax: SyntaxNode, } impl VariantList { pub fn l_curly_token(&self) -> Option { support::token(&self.syntax, T!['{']) } pub fn variants(&self) -> AstChildren { support::children(&self.syntax) } pub fn r_curly_token(&self) -> Option { support::token(&self.syntax, T!['}']) } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct Variant { pub(crate) syntax: SyntaxNode, } impl ast::AttrsOwner for Variant {} impl ast::NameOwner for Variant {} impl ast::VisibilityOwner for Variant {} impl Variant { pub fn field_list(&self) -> Option { support::child(&self.syntax) } pub fn eq_token(&self) -> Option { support::token(&self.syntax, T![=]) } pub fn expr(&self) -> Option { support::child(&self.syntax) } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct AssocItemList { pub(crate) syntax: SyntaxNode, } impl ast::AttrsOwner for AssocItemList {} impl AssocItemList { pub fn l_curly_token(&self) -> Option { support::token(&self.syntax, T!['{']) } pub fn assoc_items(&self) -> AstChildren { support::children(&self.syntax) } pub fn r_curly_token(&self) -> Option { support::token(&self.syntax, T!['}']) } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct ExternItemList { pub(crate) syntax: SyntaxNode, } impl ast::AttrsOwner for ExternItemList {} impl ExternItemList { pub fn l_curly_token(&self) -> Option { support::token(&self.syntax, T!['{']) } pub fn extern_items(&self) -> AstChildren { support::children(&self.syntax) } pub fn r_curly_token(&self) -> Option { support::token(&self.syntax, T!['}']) } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct ConstParam { pub(crate) syntax: SyntaxNode, } impl ast::AttrsOwner for ConstParam {} impl ast::NameOwner for ConstParam {} impl ConstParam { pub fn const_token(&self) -> Option { support::token(&self.syntax, T![const]) } pub fn colon_token(&self) -> Option { support::token(&self.syntax, T![:]) } pub fn ty(&self) -> Option { support::child(&self.syntax) } pub fn eq_token(&self) -> Option { support::token(&self.syntax, T![=]) } pub fn default_val(&self) -> Option { support::child(&self.syntax) } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct LifetimeParam { pub(crate) syntax: SyntaxNode, } impl ast::AttrsOwner for LifetimeParam {} impl ast::TypeBoundsOwner for LifetimeParam {} impl LifetimeParam { pub fn lifetime(&self) -> Option { support::child(&self.syntax) } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct TypeParam { pub(crate) syntax: SyntaxNode, } impl ast::AttrsOwner for TypeParam {} impl ast::NameOwner for TypeParam {} impl ast::TypeBoundsOwner for TypeParam {} impl TypeParam { pub fn eq_token(&self) -> Option { support::token(&self.syntax, T![=]) } pub fn default_type(&self) -> Option { support::child(&self.syntax) } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct WherePred { pub(crate) syntax: SyntaxNode, } impl ast::TypeBoundsOwner for WherePred {} impl WherePred { pub fn for_token(&self) -> Option { support::token(&self.syntax, T![for]) } pub fn generic_param_list(&self) -> Option { support::child(&self.syntax) } pub fn lifetime(&self) -> Option { support::child(&self.syntax) } pub fn ty(&self) -> Option { support::child(&self.syntax) } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct Literal { pub(crate) syntax: SyntaxNode, } impl ast::AttrsOwner for Literal {} impl Literal {} #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct ExprStmt { pub(crate) syntax: SyntaxNode, } impl ast::AttrsOwner for ExprStmt {} impl ExprStmt { pub fn expr(&self) -> Option { support::child(&self.syntax) } pub fn semicolon_token(&self) -> Option { support::token(&self.syntax, T![;]) } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct LetStmt { pub(crate) syntax: SyntaxNode, } impl ast::AttrsOwner for LetStmt {} impl LetStmt { pub fn let_token(&self) -> Option { support::token(&self.syntax, T![let]) } pub fn pat(&self) -> Option { support::child(&self.syntax) } pub fn colon_token(&self) -> Option { support::token(&self.syntax, T![:]) } pub fn ty(&self) -> Option { support::child(&self.syntax) } pub fn eq_token(&self) -> Option { support::token(&self.syntax, T![=]) } pub fn initializer(&self) -> Option { support::child(&self.syntax) } pub fn semicolon_token(&self) -> Option { support::token(&self.syntax, T![;]) } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct ArrayExpr { pub(crate) syntax: SyntaxNode, } impl ast::AttrsOwner for ArrayExpr {} impl ArrayExpr { pub fn l_brack_token(&self) -> Option { support::token(&self.syntax, T!['[']) } pub fn exprs(&self) -> AstChildren { support::children(&self.syntax) } pub fn expr(&self) -> Option { support::child(&self.syntax) } pub fn semicolon_token(&self) -> Option { support::token(&self.syntax, T![;]) } pub fn r_brack_token(&self) -> Option { support::token(&self.syntax, T![']']) } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct AwaitExpr { pub(crate) syntax: SyntaxNode, } impl ast::AttrsOwner for AwaitExpr {} impl AwaitExpr { pub fn expr(&self) -> Option { support::child(&self.syntax) } pub fn dot_token(&self) -> Option { support::token(&self.syntax, T![.]) } pub fn await_token(&self) -> Option { support::token(&self.syntax, T![await]) } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct BinExpr { pub(crate) syntax: SyntaxNode, } impl ast::AttrsOwner for BinExpr {} impl BinExpr {} #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct BoxExpr { pub(crate) syntax: SyntaxNode, } impl ast::AttrsOwner for BoxExpr {} impl BoxExpr { pub fn box_token(&self) -> Option { support::token(&self.syntax, T![box]) } pub fn expr(&self) -> Option { support::child(&self.syntax) } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct BreakExpr { pub(crate) syntax: SyntaxNode, } impl ast::AttrsOwner for BreakExpr {} impl BreakExpr { pub fn break_token(&self) -> Option { support::token(&self.syntax, T![break]) } pub fn lifetime(&self) -> Option { support::child(&self.syntax) } pub fn expr(&self) -> Option { support::child(&self.syntax) } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct CallExpr { pub(crate) syntax: SyntaxNode, } impl ast::AttrsOwner for CallExpr {} impl ast::ArgListOwner for CallExpr {} impl CallExpr { pub fn expr(&self) -> Option { support::child(&self.syntax) } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct CastExpr { pub(crate) syntax: SyntaxNode, } impl ast::AttrsOwner for CastExpr {} impl CastExpr { pub fn expr(&self) -> Option { support::child(&self.syntax) } pub fn as_token(&self) -> Option { support::token(&self.syntax, T![as]) } pub fn ty(&self) -> Option { support::child(&self.syntax) } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct ClosureExpr { pub(crate) syntax: SyntaxNode, } impl ast::AttrsOwner for ClosureExpr {} impl ClosureExpr { pub fn static_token(&self) -> Option { support::token(&self.syntax, T![static]) } pub fn async_token(&self) -> Option { support::token(&self.syntax, T![async]) } pub fn move_token(&self) -> Option { support::token(&self.syntax, T![move]) } pub fn param_list(&self) -> Option { support::child(&self.syntax) } pub fn ret_type(&self) -> Option { support::child(&self.syntax) } pub fn body(&self) -> Option { support::child(&self.syntax) } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct ContinueExpr { pub(crate) syntax: SyntaxNode, } impl ast::AttrsOwner for ContinueExpr {} impl ContinueExpr { pub fn continue_token(&self) -> Option { support::token(&self.syntax, T![continue]) } pub fn lifetime(&self) -> Option { support::child(&self.syntax) } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct EffectExpr { pub(crate) syntax: SyntaxNode, } impl ast::AttrsOwner for EffectExpr {} impl EffectExpr { pub fn label(&self) -> Option