//! 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 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 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 input(&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 ConstDef { pub(crate) syntax: SyntaxNode, } impl ast::AttrsOwner for ConstDef {} impl ast::NameOwner for ConstDef {} impl ast::VisibilityOwner for ConstDef {} impl ast::TypeAscriptionOwner for ConstDef {} impl ConstDef { 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 colon_token(&self) -> Option { support::token(&self.syntax, T![:]) } 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 EnumDef { pub(crate) syntax: SyntaxNode, } impl ast::AttrsOwner for EnumDef {} impl ast::NameOwner for EnumDef {} impl ast::VisibilityOwner for EnumDef {} impl ast::GenericParamsOwner for EnumDef {} impl EnumDef { 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 self_token(&self) -> Option { support::token(&self.syntax, T![self]) } 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 async_token(&self) -> Option { support::token(&self.syntax, T![async]) } pub fn const_token(&self) -> Option { support::token(&self.syntax, T![const]) } 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 ImplDef { pub(crate) syntax: SyntaxNode, } impl ast::AttrsOwner for ImplDef {} impl ast::VisibilityOwner for ImplDef {} impl ast::GenericParamsOwner for ImplDef {} impl ImplDef { pub fn const_token(&self) -> Option { support::token(&self.syntax, T![const]) } 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 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 MacroCall { pub(crate) syntax: SyntaxNode, } impl ast::AttrsOwner for MacroCall {} impl ast::NameOwner 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 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 StaticDef { pub(crate) syntax: SyntaxNode, } impl ast::AttrsOwner for StaticDef {} impl ast::NameOwner for StaticDef {} impl ast::VisibilityOwner for StaticDef {} impl ast::TypeAscriptionOwner for StaticDef {} impl StaticDef { 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 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 StructDef { pub(crate) syntax: SyntaxNode, } impl ast::AttrsOwner for StructDef {} impl ast::NameOwner for StructDef {} impl ast::VisibilityOwner for StructDef {} impl ast::GenericParamsOwner for StructDef {} impl StructDef { 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_def_list(&self) -> Option { support::child(&self.syntax) } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct TraitDef { pub(crate) syntax: SyntaxNode, } impl ast::AttrsOwner for TraitDef {} impl ast::NameOwner for TraitDef {} impl ast::VisibilityOwner for TraitDef {} impl ast::GenericParamsOwner for TraitDef {} impl ast::TypeBoundsOwner for TraitDef {} impl TraitDef { 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 type_ref(&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 UnionDef { pub(crate) syntax: SyntaxNode, } impl ast::AttrsOwner for UnionDef {} impl ast::NameOwner for UnionDef {} impl ast::VisibilityOwner for UnionDef {} impl ast::GenericParamsOwner for UnionDef {} impl UnionDef { pub fn union_token(&self) -> Option { support::token(&self.syntax, T![union]) } pub fn record_field_def_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 super_token(&self) -> Option { support::token(&self.syntax, T![super]) } pub fn self_token(&self) -> Option { support::token(&self.syntax, T![self]) } pub fn crate_token(&self) -> Option { support::token(&self.syntax, T![crate]) } 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 Name { pub(crate) syntax: SyntaxNode, } impl Name { pub fn ident_token(&self) -> Option { support::token(&self.syntax, T![ident]) } } #[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 NameRef { pub(crate) syntax: SyntaxNode, } impl NameRef { pub fn ident_token(&self) -> Option { support::token(&self.syntax, T![ident]) } } #[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 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 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 type_params(&self) -> AstChildren { support::children(&self.syntax) } pub fn lifetime_params(&self) -> AstChildren { support::children(&self.syntax) } pub fn const_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 ParamList { pub(crate) syntax: SyntaxNode, } impl ParamList { pub fn l_paren_token(&self) -> Option { support::token(&self.syntax, T!['(']) } pub fn params(&self) -> AstChildren { support::children(&self.syntax) } pub fn self_param(&self) -> Option { support::child(&self.syntax) } pub fn comma_token(&self) -> Option { support::token(&self.syntax, T![,]) } pub fn r_paren_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 type_ref(&self) -> Option { support::child(&self.syntax) } } #[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 ast::ModuleItemOwner for BlockExpr {} impl BlockExpr { pub fn label(&self) -> Option