//! 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::ModuleItemOwner for SourceFile {} impl ast::AttrsOwner for SourceFile {} impl SourceFile { pub fn modules(&self) -> AstChildren { support::children(&self.syntax) } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct FnDef { pub(crate) syntax: SyntaxNode, } impl ast::VisibilityOwner for FnDef {} impl ast::NameOwner for FnDef {} impl ast::TypeParamsOwner for FnDef {} impl ast::DocCommentsOwner for FnDef {} impl ast::AttrsOwner for FnDef {} impl FnDef { pub fn abi(&self) -> Option { support::child(&self.syntax) } 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 async_token(&self) -> Option { support::token(&self.syntax, T![async]) } pub fn unsafe_token(&self) -> Option { support::token(&self.syntax, T![unsafe]) } 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 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 StructDef { pub(crate) syntax: SyntaxNode, } impl ast::VisibilityOwner for StructDef {} impl ast::NameOwner for StructDef {} impl ast::TypeParamsOwner for StructDef {} impl ast::AttrsOwner for StructDef {} impl ast::DocCommentsOwner for StructDef {} impl StructDef { pub fn struct_token(&self) -> Option { support::token(&self.syntax, T![struct]) } pub fn field_def_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 UnionDef { pub(crate) syntax: SyntaxNode, } impl ast::VisibilityOwner for UnionDef {} impl ast::NameOwner for UnionDef {} impl ast::TypeParamsOwner for UnionDef {} impl ast::AttrsOwner for UnionDef {} impl ast::DocCommentsOwner 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 RecordFieldDefList { pub(crate) syntax: SyntaxNode, } impl RecordFieldDefList { 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 RecordFieldDef { pub(crate) syntax: SyntaxNode, } impl ast::VisibilityOwner for RecordFieldDef {} impl ast::NameOwner for RecordFieldDef {} impl ast::AttrsOwner for RecordFieldDef {} impl ast::DocCommentsOwner for RecordFieldDef {} impl ast::TypeAscriptionOwner for RecordFieldDef {} impl RecordFieldDef {} #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct TupleFieldDefList { pub(crate) syntax: SyntaxNode, } impl TupleFieldDefList { 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 TupleFieldDef { pub(crate) syntax: SyntaxNode, } impl ast::VisibilityOwner for TupleFieldDef {} impl ast::AttrsOwner for TupleFieldDef {} impl TupleFieldDef { pub fn type_ref(&self) -> Option { support::child(&self.syntax) } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct EnumDef { pub(crate) syntax: SyntaxNode, } impl ast::VisibilityOwner for EnumDef {} impl ast::NameOwner for EnumDef {} impl ast::TypeParamsOwner for EnumDef {} impl ast::AttrsOwner for EnumDef {} impl ast::DocCommentsOwner 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 EnumVariantList { pub(crate) syntax: SyntaxNode, } impl EnumVariantList { 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 EnumVariant { pub(crate) syntax: SyntaxNode, } impl ast::VisibilityOwner for EnumVariant {} impl ast::NameOwner for EnumVariant {} impl ast::DocCommentsOwner for EnumVariant {} impl ast::AttrsOwner for EnumVariant {} impl EnumVariant { pub fn field_def_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 TraitDef { pub(crate) syntax: SyntaxNode, } impl ast::VisibilityOwner for TraitDef {} impl ast::NameOwner for TraitDef {} impl ast::AttrsOwner for TraitDef {} impl ast::DocCommentsOwner for TraitDef {} impl ast::TypeParamsOwner 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 item_list(&self) -> Option { support::child(&self.syntax) } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct Module { pub(crate) syntax: SyntaxNode, } impl ast::VisibilityOwner for Module {} impl ast::NameOwner for Module {} impl ast::AttrsOwner for Module {} impl ast::DocCommentsOwner 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 ItemList { pub(crate) syntax: SyntaxNode, } impl ast::ModuleItemOwner for ItemList {} impl ItemList { pub fn l_curly_token(&self) -> Option { support::token(&self.syntax, T!['{']) } pub fn impl_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 ConstDef { pub(crate) syntax: SyntaxNode, } impl ast::VisibilityOwner for ConstDef {} impl ast::NameOwner for ConstDef {} impl ast::TypeParamsOwner for ConstDef {} impl ast::AttrsOwner for ConstDef {} impl ast::DocCommentsOwner 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 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 StaticDef { pub(crate) syntax: SyntaxNode, } impl ast::VisibilityOwner for StaticDef {} impl ast::NameOwner for StaticDef {} impl ast::TypeParamsOwner for StaticDef {} impl ast::AttrsOwner for StaticDef {} impl ast::DocCommentsOwner 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 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 TypeAliasDef { pub(crate) syntax: SyntaxNode, } impl ast::VisibilityOwner for TypeAliasDef {} impl ast::NameOwner for TypeAliasDef {} impl ast::TypeParamsOwner for TypeAliasDef {} impl ast::AttrsOwner for TypeAliasDef {} impl ast::DocCommentsOwner for TypeAliasDef {} impl ast::TypeBoundsOwner for TypeAliasDef {} impl TypeAliasDef { 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 ImplDef { pub(crate) syntax: SyntaxNode, } impl ast::TypeParamsOwner for ImplDef {} impl ast::AttrsOwner for ImplDef {} impl ImplDef { 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 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 item_list(&self) -> Option { support::child(&self.syntax) } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct ParenType { pub(crate) syntax: SyntaxNode, } impl ParenType { pub fn l_paren_token(&self) -> Option { support::token(&self.syntax, T!['(']) } pub fn type_ref(&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 TupleType { pub(crate) syntax: SyntaxNode, } impl TupleType { 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 NeverType { pub(crate) syntax: SyntaxNode, } impl NeverType { pub fn excl_token(&self) -> Option { support::token(&self.syntax, T![!]) } } #[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 PointerType { pub(crate) syntax: SyntaxNode, } impl PointerType { pub fn star_token(&self) -> Option { support::token(&self.syntax, T![*]) } pub fn const_token(&self) -> Option { support::token(&self.syntax, T![const]) } pub fn mut_token(&self) -> Option { support::token(&self.syntax, T![mut]) } pub fn type_ref(&self) -> Option { support::child(&self.syntax) } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct ArrayType { pub(crate) syntax: SyntaxNode, } impl ArrayType { pub fn l_brack_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![;]) } pub fn expr(&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 SliceType { pub(crate) syntax: SyntaxNode, } impl SliceType { pub fn l_brack_token(&self) -> Option { support::token(&self.syntax, T!['[']) } pub fn type_ref(&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 ReferenceType { pub(crate) syntax: SyntaxNode, } impl ReferenceType { pub fn amp_token(&self) -> Option { support::token(&self.syntax, T![&]) } pub fn lifetime_token(&self) -> Option { support::token(&self.syntax, T![lifetime]) } pub fn mut_token(&self) -> Option { support::token(&self.syntax, T![mut]) } pub fn type_ref(&self) -> Option { support::child(&self.syntax) } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct PlaceholderType { pub(crate) syntax: SyntaxNode, } impl PlaceholderType { pub fn underscore_token(&self) -> Option { support::token(&self.syntax, T![_]) } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct FnPointerType { pub(crate) syntax: SyntaxNode, } impl FnPointerType { pub fn abi(&self) -> Option { support::child(&self.syntax) } pub fn unsafe_token(&self) -> Option { support::token(&self.syntax, T![unsafe]) } 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) } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct ForType { pub(crate) syntax: SyntaxNode, } impl ForType { pub fn for_token(&self) -> Option { support::token(&self.syntax, T![for]) } pub fn type_param_list(&self) -> Option { support::child(&self.syntax) } pub fn type_ref(&self) -> Option { support::child(&self.syntax) } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct ImplTraitType { pub(crate) syntax: SyntaxNode, } impl ast::TypeBoundsOwner for ImplTraitType {} impl ImplTraitType { pub fn impl_token(&self) -> Option { support::token(&self.syntax, T![impl]) } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct DynTraitType { pub(crate) syntax: SyntaxNode, } impl ast::TypeBoundsOwner for DynTraitType {} impl DynTraitType { pub fn dyn_token(&self) -> Option { support::token(&self.syntax, T![dyn]) } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct TupleExpr { pub(crate) syntax: SyntaxNode, } impl ast::AttrsOwner for TupleExpr {} impl TupleExpr { pub fn l_paren_token(&self) -> Option { support::token(&self.syntax, T!['(']) } pub fn exprs(&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 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 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 ParenExpr { pub(crate) syntax: SyntaxNode, } impl ast::AttrsOwner for ParenExpr {} impl ParenExpr { pub fn l_paren_token(&self) -> Option { support::token(&self.syntax, T!['(']) } pub fn expr(&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 PathExpr { pub(crate) syntax: SyntaxNode, } impl PathExpr { pub fn path(&self) -> Option { support::child(&self.syntax) } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct LambdaExpr { pub(crate) syntax: SyntaxNode, } impl ast::AttrsOwner for LambdaExpr {} impl LambdaExpr { 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 IfExpr { pub(crate) syntax: SyntaxNode, } impl ast::AttrsOwner for IfExpr {} impl IfExpr { pub fn if_token(&self) -> Option { support::token(&self.syntax, T![if]) } pub fn condition(&self) -> Option { support::child(&self.syntax) } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct LoopExpr { pub(crate) syntax: SyntaxNode, } impl ast::AttrsOwner for LoopExpr {} impl ast::LoopBodyOwner for LoopExpr {} impl LoopExpr { pub fn loop_token(&self) -> Option { support::token(&self.syntax, T![loop]) } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct TryBlockExpr { pub(crate) syntax: SyntaxNode, } impl ast::AttrsOwner for TryBlockExpr {} impl TryBlockExpr { pub fn try_token(&self) -> Option { support::token(&self.syntax, T![try]) } pub fn body(&self) -> Option { support::child(&self.syntax) } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct ForExpr { pub(crate) syntax: SyntaxNode, } impl ast::AttrsOwner for ForExpr {} impl ast::LoopBodyOwner for ForExpr {} impl ForExpr { pub fn for_token(&self) -> Option { support::token(&self.syntax, T![for]) } pub fn pat(&self) -> Option { support::child(&self.syntax) } pub fn in_token(&self) -> Option { support::token(&self.syntax, T![in]) } pub fn iterable(&self) -> Option { support::child(&self.syntax) } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct WhileExpr { pub(crate) syntax: SyntaxNode, } impl ast::AttrsOwner for WhileExpr {} impl ast::LoopBodyOwner for WhileExpr {} impl WhileExpr { pub fn while_token(&self) -> Option { support::token(&self.syntax, T![while]) } pub fn condition(&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_token(&self) -> Option { support::token(&self.syntax, T![lifetime]) } } #[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_token(&self) -> Option { support::token(&self.syntax, T![lifetime]) } pub fn expr(&self) -> Option { support::child(&self.syntax) } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct Label { pub(crate) syntax: SyntaxNode, } impl Label { pub fn lifetime_token(&self) -> Option { support::token(&self.syntax, T![lifetime]) } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct BlockExpr { pub(crate) syntax: SyntaxNode, } impl ast::AttrsOwner for BlockExpr {} impl BlockExpr { pub fn label(&self) -> Option