#![allow(non_snake_case)]
use crate::{
ast::{self, support, AstChildren, AstNode},
SyntaxKind::{self, *},
SyntaxNode, SyntaxToken, T,
};
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct Abi {
pub(crate) syntax: SyntaxNode,
}
impl Abi {
#[inline]
pub fn extern_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![extern]) }
#[inline]
pub fn string_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![string]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct ArgList {
pub(crate) syntax: SyntaxNode,
}
impl ArgList {
#[inline]
pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['(']) }
#[inline]
pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct ArrayExpr {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for ArrayExpr {}
impl ArrayExpr {
#[inline]
pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
#[inline]
pub fn exprs(&self) -> AstChildren<Expr> { support::children(&self.syntax) }
#[inline]
pub fn l_brack_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['[']) }
#[inline]
pub fn r_brack_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![']']) }
#[inline]
pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct ArrayType {
pub(crate) syntax: SyntaxNode,
}
impl ArrayType {
#[inline]
pub fn const_arg(&self) -> Option<ConstArg> { support::child(&self.syntax) }
#[inline]
pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) }
#[inline]
pub fn l_brack_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['[']) }
#[inline]
pub fn r_brack_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![']']) }
#[inline]
pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct AsmClobberAbi {
pub(crate) syntax: SyntaxNode,
}
impl AsmClobberAbi {
#[inline]
pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['(']) }
#[inline]
pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) }
#[inline]
pub fn clobber_abi_token(&self) -> Option<SyntaxToken> {
support::token(&self.syntax, T![clobber_abi])
}
#[inline]
pub fn string_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![string]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct AsmConst {
pub(crate) syntax: SyntaxNode,
}
impl AsmConst {
#[inline]
pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
#[inline]
pub fn const_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![const]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct AsmDirSpec {
pub(crate) syntax: SyntaxNode,
}
impl AsmDirSpec {
#[inline]
pub fn in_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![in]) }
#[inline]
pub fn inlateout_token(&self) -> Option<SyntaxToken> {
support::token(&self.syntax, T![inlateout])
}
#[inline]
pub fn inout_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![inout]) }
#[inline]
pub fn lateout_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![lateout]) }
#[inline]
pub fn out_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![out]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct AsmExpr {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for AsmExpr {}
impl AsmExpr {
#[inline]
pub fn asm_pieces(&self) -> AstChildren<AsmPiece> { support::children(&self.syntax) }
#[inline]
pub fn template(&self) -> AstChildren<Expr> { support::children(&self.syntax) }
#[inline]
pub fn pound_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![#]) }
#[inline]
pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['(']) }
#[inline]
pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) }
#[inline]
pub fn comma_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![,]) }
#[inline]
pub fn asm_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![asm]) }
#[inline]
pub fn builtin_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![builtin]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct AsmLabel {
pub(crate) syntax: SyntaxNode,
}
impl AsmLabel {
#[inline]
pub fn block_expr(&self) -> Option<BlockExpr> { support::child(&self.syntax) }
#[inline]
pub fn label_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![label]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct AsmOperandExpr {
pub(crate) syntax: SyntaxNode,
}
impl AsmOperandExpr {
#[inline]
pub fn in_expr(&self) -> Option<Expr> { support::child(&self.syntax) }
#[inline]
pub fn out_expr(&self) -> Option<Expr> { support::child(&self.syntax) }
#[inline]
pub fn fat_arrow_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=>]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct AsmOperandNamed {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasName for AsmOperandNamed {}
impl AsmOperandNamed {
#[inline]
pub fn asm_operand(&self) -> Option<AsmOperand> { support::child(&self.syntax) }
#[inline]
pub fn eq_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct AsmOption {
pub(crate) syntax: SyntaxNode,
}
impl AsmOption {
#[inline]
pub fn att_syntax_token(&self) -> Option<SyntaxToken> {
support::token(&self.syntax, T![att_syntax])
}
#[inline]
pub fn may_unwind_token(&self) -> Option<SyntaxToken> {
support::token(&self.syntax, T![may_unwind])
}
#[inline]
pub fn nomem_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![nomem]) }
#[inline]
pub fn noreturn_token(&self) -> Option<SyntaxToken> {
support::token(&self.syntax, T![noreturn])
}
#[inline]
pub fn nostack_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![nostack]) }
#[inline]
pub fn preserves_flags_token(&self) -> Option<SyntaxToken> {
support::token(&self.syntax, T![preserves_flags])
}
#[inline]
pub fn pure_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![pure]) }
#[inline]
pub fn raw_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![raw]) }
#[inline]
pub fn readonly_token(&self) -> Option<SyntaxToken> {
support::token(&self.syntax, T![readonly])
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct AsmOptions {
pub(crate) syntax: SyntaxNode,
}
impl AsmOptions {
#[inline]
pub fn asm_options(&self) -> AstChildren<AsmOption> { support::children(&self.syntax) }
#[inline]
pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['(']) }
#[inline]
pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) }
#[inline]
pub fn comma_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![,]) }
#[inline]
pub fn options_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![options]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct AsmRegOperand {
pub(crate) syntax: SyntaxNode,
}
impl AsmRegOperand {
#[inline]
pub fn asm_dir_spec(&self) -> Option<AsmDirSpec> { support::child(&self.syntax) }
#[inline]
pub fn asm_operand_expr(&self) -> Option<AsmOperandExpr> { support::child(&self.syntax) }
#[inline]
pub fn asm_reg_spec(&self) -> Option<AsmRegSpec> { support::child(&self.syntax) }
#[inline]
pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['(']) }
#[inline]
pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct AsmRegSpec {
pub(crate) syntax: SyntaxNode,
}
impl AsmRegSpec {
#[inline]
pub fn name_ref(&self) -> Option<NameRef> { support::child(&self.syntax) }
#[inline]
pub fn string_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![string]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct AsmSym {
pub(crate) syntax: SyntaxNode,
}
impl AsmSym {
#[inline]
pub fn path(&self) -> Option<Path> { support::child(&self.syntax) }
#[inline]
pub fn sym_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![sym]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct AssocItemList {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for AssocItemList {}
impl AssocItemList {
#[inline]
pub fn assoc_items(&self) -> AstChildren<AssocItem> { support::children(&self.syntax) }
#[inline]
pub fn l_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['{']) }
#[inline]
pub fn r_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['}']) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct AssocTypeArg {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasGenericArgs for AssocTypeArg {}
impl ast::HasTypeBounds for AssocTypeArg {}
impl AssocTypeArg {
#[inline]
pub fn const_arg(&self) -> Option<ConstArg> { support::child(&self.syntax) }
#[inline]
pub fn name_ref(&self) -> Option<NameRef> { support::child(&self.syntax) }
#[inline]
pub fn param_list(&self) -> Option<ParamList> { support::child(&self.syntax) }
#[inline]
pub fn ret_type(&self) -> Option<RetType> { support::child(&self.syntax) }
#[inline]
pub fn return_type_syntax(&self) -> Option<ReturnTypeSyntax> { support::child(&self.syntax) }
#[inline]
pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) }
#[inline]
pub fn eq_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct Attr {
pub(crate) syntax: SyntaxNode,
}
impl Attr {
#[inline]
pub fn meta(&self) -> Option<Meta> { support::child(&self.syntax) }
#[inline]
pub fn excl_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![!]) }
#[inline]
pub fn pound_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![#]) }
#[inline]
pub fn l_brack_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['[']) }
#[inline]
pub fn r_brack_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![']']) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct AwaitExpr {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for AwaitExpr {}
impl AwaitExpr {
#[inline]
pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
#[inline]
pub fn dot_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![.]) }
#[inline]
pub fn await_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![await]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct BecomeExpr {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for BecomeExpr {}
impl BecomeExpr {
#[inline]
pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
#[inline]
pub fn become_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![become]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct BinExpr {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for BinExpr {}
impl BinExpr {}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct BlockExpr {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for BlockExpr {}
impl BlockExpr {
#[inline]
pub fn label(&self) -> Option<Label> { support::child(&self.syntax) }
#[inline]
pub fn stmt_list(&self) -> Option<StmtList> { support::child(&self.syntax) }
#[inline]
pub fn async_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![async]) }
#[inline]
pub fn const_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![const]) }
#[inline]
pub fn gen_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![gen]) }
#[inline]
pub fn move_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![move]) }
#[inline]
pub fn try_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![try]) }
#[inline]
pub fn unsafe_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![unsafe]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct BoxPat {
pub(crate) syntax: SyntaxNode,
}
impl BoxPat {
#[inline]
pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) }
#[inline]
pub fn box_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![box]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct BreakExpr {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for BreakExpr {}
impl BreakExpr {
#[inline]
pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
#[inline]
pub fn lifetime(&self) -> Option<Lifetime> { support::child(&self.syntax) }
#[inline]
pub fn break_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![break]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct CallExpr {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasArgList for CallExpr {}
impl ast::HasAttrs for CallExpr {}
impl CallExpr {
#[inline]
pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct CastExpr {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for CastExpr {}
impl CastExpr {
#[inline]
pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
#[inline]
pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) }
#[inline]
pub fn as_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![as]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct ClosureBinder {
pub(crate) syntax: SyntaxNode,
}
impl ClosureBinder {
#[inline]
pub fn generic_param_list(&self) -> Option<GenericParamList> { support::child(&self.syntax) }
#[inline]
pub fn for_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![for]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct ClosureExpr {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for ClosureExpr {}
impl ClosureExpr {
#[inline]
pub fn closure_binder(&self) -> Option<ClosureBinder> { support::child(&self.syntax) }
#[inline]
pub fn param_list(&self) -> Option<ParamList> { support::child(&self.syntax) }
#[inline]
pub fn ret_type(&self) -> Option<RetType> { support::child(&self.syntax) }
#[inline]
pub fn async_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![async]) }
#[inline]
pub fn const_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![const]) }
#[inline]
pub fn gen_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![gen]) }
#[inline]
pub fn move_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![move]) }
#[inline]
pub fn static_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![static]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct Const {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for Const {}
impl ast::HasDocComments for Const {}
impl ast::HasName for Const {}
impl ast::HasVisibility for Const {}
impl Const {
#[inline]
pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) }
#[inline]
pub fn colon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![:]) }
#[inline]
pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) }
#[inline]
pub fn eq_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=]) }
#[inline]
pub fn underscore_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![_]) }
#[inline]
pub fn const_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![const]) }
#[inline]
pub fn default_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![default]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct ConstArg {
pub(crate) syntax: SyntaxNode,
}
impl ConstArg {
#[inline]
pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct ConstBlockPat {
pub(crate) syntax: SyntaxNode,
}
impl ConstBlockPat {
#[inline]
pub fn block_expr(&self) -> Option<BlockExpr> { support::child(&self.syntax) }
#[inline]
pub fn const_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![const]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct ConstParam {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for ConstParam {}
impl ast::HasName for ConstParam {}
impl ConstParam {
#[inline]
pub fn default_val(&self) -> Option<ConstArg> { support::child(&self.syntax) }
#[inline]
pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) }
#[inline]
pub fn colon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![:]) }
#[inline]
pub fn eq_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=]) }
#[inline]
pub fn const_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![const]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct ContinueExpr {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for ContinueExpr {}
impl ContinueExpr {
#[inline]
pub fn lifetime(&self) -> Option<Lifetime> { support::child(&self.syntax) }
#[inline]
pub fn continue_token(&self) -> Option<SyntaxToken> {
support::token(&self.syntax, T![continue])
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct DynTraitType {
pub(crate) syntax: SyntaxNode,
}
impl DynTraitType {
#[inline]
pub fn type_bound_list(&self) -> Option<TypeBoundList> { support::child(&self.syntax) }
#[inline]
pub fn dyn_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![dyn]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct Enum {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for Enum {}
impl ast::HasDocComments for Enum {}
impl ast::HasGenericParams for Enum {}
impl ast::HasName for Enum {}
impl ast::HasVisibility for Enum {}
impl Enum {
#[inline]
pub fn variant_list(&self) -> Option<VariantList> { support::child(&self.syntax) }
#[inline]
pub fn enum_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![enum]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct ExprStmt {
pub(crate) syntax: SyntaxNode,
}
impl ExprStmt {
#[inline]
pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
#[inline]
pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct ExternBlock {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for ExternBlock {}
impl ast::HasDocComments for ExternBlock {}
impl ExternBlock {
#[inline]
pub fn abi(&self) -> Option<Abi> { support::child(&self.syntax) }
#[inline]
pub fn extern_item_list(&self) -> Option<ExternItemList> { support::child(&self.syntax) }
#[inline]
pub fn unsafe_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![unsafe]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct ExternCrate {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for ExternCrate {}
impl ast::HasDocComments for ExternCrate {}
impl ast::HasVisibility for ExternCrate {}
impl ExternCrate {
#[inline]
pub fn name_ref(&self) -> Option<NameRef> { support::child(&self.syntax) }
#[inline]
pub fn rename(&self) -> Option<Rename> { support::child(&self.syntax) }
#[inline]
pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) }
#[inline]
pub fn crate_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![crate]) }
#[inline]
pub fn extern_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![extern]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct ExternItemList {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for ExternItemList {}
impl ExternItemList {
#[inline]
pub fn extern_items(&self) -> AstChildren<ExternItem> { support::children(&self.syntax) }
#[inline]
pub fn l_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['{']) }
#[inline]
pub fn r_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['}']) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct FieldExpr {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for FieldExpr {}
impl FieldExpr {
#[inline]
pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
#[inline]
pub fn name_ref(&self) -> Option<NameRef> { support::child(&self.syntax) }
#[inline]
pub fn dot_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![.]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct Fn {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for Fn {}
impl ast::HasDocComments for Fn {}
impl ast::HasGenericParams for Fn {}
impl ast::HasName for Fn {}
impl ast::HasVisibility for Fn {}
impl Fn {
#[inline]
pub fn abi(&self) -> Option<Abi> { support::child(&self.syntax) }
#[inline]
pub fn param_list(&self) -> Option<ParamList> { support::child(&self.syntax) }
#[inline]
pub fn ret_type(&self) -> Option<RetType> { support::child(&self.syntax) }
#[inline]
pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) }
#[inline]
pub fn async_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![async]) }
#[inline]
pub fn const_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![const]) }
#[inline]
pub fn default_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![default]) }
#[inline]
pub fn fn_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![fn]) }
#[inline]
pub fn gen_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![gen]) }
#[inline]
pub fn safe_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![safe]) }
#[inline]
pub fn unsafe_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![unsafe]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct FnPtrType {
pub(crate) syntax: SyntaxNode,
}
impl FnPtrType {
#[inline]
pub fn abi(&self) -> Option<Abi> { support::child(&self.syntax) }
#[inline]
pub fn param_list(&self) -> Option<ParamList> { support::child(&self.syntax) }
#[inline]
pub fn ret_type(&self) -> Option<RetType> { support::child(&self.syntax) }
#[inline]
pub fn async_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![async]) }
#[inline]
pub fn const_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![const]) }
#[inline]
pub fn fn_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![fn]) }
#[inline]
pub fn unsafe_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![unsafe]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct ForExpr {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for ForExpr {}
impl ForExpr {
#[inline]
pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) }
#[inline]
pub fn for_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![for]) }
#[inline]
pub fn in_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![in]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct ForType {
pub(crate) syntax: SyntaxNode,
}
impl ForType {
#[inline]
pub fn generic_param_list(&self) -> Option<GenericParamList> { support::child(&self.syntax) }
#[inline]
pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) }
#[inline]
pub fn for_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![for]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct FormatArgsArg {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasName for FormatArgsArg {}
impl FormatArgsArg {
#[inline]
pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
#[inline]
pub fn eq_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct FormatArgsExpr {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for FormatArgsExpr {}
impl FormatArgsExpr {
#[inline]
pub fn template(&self) -> Option<Expr> { support::child(&self.syntax) }
#[inline]
pub fn pound_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![#]) }
#[inline]
pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['(']) }
#[inline]
pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) }
#[inline]
pub fn comma_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![,]) }
#[inline]
pub fn builtin_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![builtin]) }
#[inline]
pub fn format_args_token(&self) -> Option<SyntaxToken> {
support::token(&self.syntax, T![format_args])
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct GenericArgList {
pub(crate) syntax: SyntaxNode,
}
impl GenericArgList {
#[inline]
pub fn generic_args(&self) -> AstChildren<GenericArg> { support::children(&self.syntax) }
#[inline]
pub fn coloncolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![::]) }
#[inline]
pub fn l_angle_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![<]) }
#[inline]
pub fn r_angle_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![>]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct GenericParamList {
pub(crate) syntax: SyntaxNode,
}
impl GenericParamList {
#[inline]
pub fn generic_params(&self) -> AstChildren<GenericParam> { support::children(&self.syntax) }
#[inline]
pub fn l_angle_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![<]) }
#[inline]
pub fn r_angle_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![>]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct IdentPat {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for IdentPat {}
impl ast::HasName for IdentPat {}
impl IdentPat {
#[inline]
pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) }
#[inline]
pub fn at_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![@]) }
#[inline]
pub fn mut_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![mut]) }
#[inline]
pub fn ref_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![ref]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct IfExpr {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for IfExpr {}
impl IfExpr {
#[inline]
pub fn else_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![else]) }
#[inline]
pub fn if_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![if]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct Impl {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for Impl {}
impl ast::HasDocComments for Impl {}
impl ast::HasGenericParams for Impl {}
impl ast::HasVisibility for Impl {}
impl Impl {
#[inline]
pub fn assoc_item_list(&self) -> Option<AssocItemList> { support::child(&self.syntax) }
#[inline]
pub fn excl_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![!]) }
#[inline]
pub fn const_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![const]) }
#[inline]
pub fn default_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![default]) }
#[inline]
pub fn for_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![for]) }
#[inline]
pub fn impl_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![impl]) }
#[inline]
pub fn unsafe_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![unsafe]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct ImplTraitType {
pub(crate) syntax: SyntaxNode,
}
impl ImplTraitType {
#[inline]
pub fn type_bound_list(&self) -> Option<TypeBoundList> { support::child(&self.syntax) }
#[inline]
pub fn impl_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![impl]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct IndexExpr {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for IndexExpr {}
impl IndexExpr {
#[inline]
pub fn l_brack_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['[']) }
#[inline]
pub fn r_brack_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![']']) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct InferType {
pub(crate) syntax: SyntaxNode,
}
impl InferType {
#[inline]
pub fn underscore_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![_]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct ItemList {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for ItemList {}
impl ast::HasModuleItem for ItemList {}
impl ItemList {
#[inline]
pub fn l_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['{']) }
#[inline]
pub fn r_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['}']) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct Label {
pub(crate) syntax: SyntaxNode,
}
impl Label {
#[inline]
pub fn lifetime(&self) -> Option<Lifetime> { support::child(&self.syntax) }
#[inline]
pub fn colon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![:]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct LetElse {
pub(crate) syntax: SyntaxNode,
}
impl LetElse {
#[inline]
pub fn block_expr(&self) -> Option<BlockExpr> { support::child(&self.syntax) }
#[inline]
pub fn else_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![else]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct LetExpr {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for LetExpr {}
impl LetExpr {
#[inline]
pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
#[inline]
pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) }
#[inline]
pub fn eq_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=]) }
#[inline]
pub fn let_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![let]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct LetStmt {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for LetStmt {}
impl LetStmt {
#[inline]
pub fn initializer(&self) -> Option<Expr> { support::child(&self.syntax) }
#[inline]
pub fn let_else(&self) -> Option<LetElse> { support::child(&self.syntax) }
#[inline]
pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) }
#[inline]
pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) }
#[inline]
pub fn colon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![:]) }
#[inline]
pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) }
#[inline]
pub fn eq_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=]) }
#[inline]
pub fn let_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![let]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct Lifetime {
pub(crate) syntax: SyntaxNode,
}
impl Lifetime {
#[inline]
pub fn lifetime_ident_token(&self) -> Option<SyntaxToken> {
support::token(&self.syntax, T![lifetime_ident])
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct LifetimeArg {
pub(crate) syntax: SyntaxNode,
}
impl LifetimeArg {
#[inline]
pub fn lifetime(&self) -> Option<Lifetime> { support::child(&self.syntax) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct LifetimeParam {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for LifetimeParam {}
impl ast::HasTypeBounds for LifetimeParam {}
impl LifetimeParam {
#[inline]
pub fn lifetime(&self) -> Option<Lifetime> { support::child(&self.syntax) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct Literal {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for Literal {}
impl Literal {}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct LiteralPat {
pub(crate) syntax: SyntaxNode,
}
impl LiteralPat {
#[inline]
pub fn literal(&self) -> Option<Literal> { support::child(&self.syntax) }
#[inline]
pub fn minus_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![-]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct LoopExpr {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for LoopExpr {}
impl ast::HasLoopBody for LoopExpr {}
impl LoopExpr {
#[inline]
pub fn loop_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![loop]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct MacroCall {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for MacroCall {}
impl ast::HasDocComments for MacroCall {}
impl MacroCall {
#[inline]
pub fn path(&self) -> Option<Path> { support::child(&self.syntax) }
#[inline]
pub fn token_tree(&self) -> Option<TokenTree> { support::child(&self.syntax) }
#[inline]
pub fn excl_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![!]) }
#[inline]
pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct MacroDef {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for MacroDef {}
impl ast::HasDocComments for MacroDef {}
impl ast::HasName for MacroDef {}
impl ast::HasVisibility for MacroDef {}
impl MacroDef {
#[inline]
pub fn macro_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![macro]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct MacroExpr {
pub(crate) syntax: SyntaxNode,
}
impl MacroExpr {
#[inline]
pub fn macro_call(&self) -> Option<MacroCall> { support::child(&self.syntax) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct MacroItems {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasModuleItem for MacroItems {}
impl MacroItems {}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct MacroPat {
pub(crate) syntax: SyntaxNode,
}
impl MacroPat {
#[inline]
pub fn macro_call(&self) -> Option<MacroCall> { support::child(&self.syntax) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct MacroRules {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for MacroRules {}
impl ast::HasDocComments for MacroRules {}
impl ast::HasName for MacroRules {}
impl ast::HasVisibility for MacroRules {}
impl MacroRules {
#[inline]
pub fn token_tree(&self) -> Option<TokenTree> { support::child(&self.syntax) }
#[inline]
pub fn excl_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![!]) }
#[inline]
pub fn macro_rules_token(&self) -> Option<SyntaxToken> {
support::token(&self.syntax, T![macro_rules])
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct MacroStmts {
pub(crate) syntax: SyntaxNode,
}
impl MacroStmts {
#[inline]
pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
#[inline]
pub fn statements(&self) -> AstChildren<Stmt> { support::children(&self.syntax) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct MacroType {
pub(crate) syntax: SyntaxNode,
}
impl MacroType {
#[inline]
pub fn macro_call(&self) -> Option<MacroCall> { support::child(&self.syntax) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct MatchArm {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for MatchArm {}
impl MatchArm {
#[inline]
pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
#[inline]
pub fn guard(&self) -> Option<MatchGuard> { support::child(&self.syntax) }
#[inline]
pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) }
#[inline]
pub fn comma_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![,]) }
#[inline]
pub fn fat_arrow_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=>]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct MatchArmList {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for MatchArmList {}
impl MatchArmList {
#[inline]
pub fn arms(&self) -> AstChildren<MatchArm> { support::children(&self.syntax) }
#[inline]
pub fn l_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['{']) }
#[inline]
pub fn r_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['}']) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct MatchExpr {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for MatchExpr {}
impl MatchExpr {
#[inline]
pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
#[inline]
pub fn match_arm_list(&self) -> Option<MatchArmList> { support::child(&self.syntax) }
#[inline]
pub fn match_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![match]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct MatchGuard {
pub(crate) syntax: SyntaxNode,
}
impl MatchGuard {
#[inline]
pub fn if_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![if]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct Meta {
pub(crate) syntax: SyntaxNode,
}
impl Meta {
#[inline]
pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
#[inline]
pub fn path(&self) -> Option<Path> { support::child(&self.syntax) }
#[inline]
pub fn token_tree(&self) -> Option<TokenTree> { support::child(&self.syntax) }
#[inline]
pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['(']) }
#[inline]
pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) }
#[inline]
pub fn eq_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=]) }
#[inline]
pub fn unsafe_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![unsafe]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct MethodCallExpr {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasArgList for MethodCallExpr {}
impl ast::HasAttrs for MethodCallExpr {}
impl ast::HasGenericArgs for MethodCallExpr {}
impl MethodCallExpr {
#[inline]
pub fn name_ref(&self) -> Option<NameRef> { support::child(&self.syntax) }
#[inline]
pub fn receiver(&self) -> Option<Expr> { support::child(&self.syntax) }
#[inline]
pub fn dot_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![.]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct Module {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for Module {}
impl ast::HasDocComments for Module {}
impl ast::HasName for Module {}
impl ast::HasVisibility for Module {}
impl Module {
#[inline]
pub fn item_list(&self) -> Option<ItemList> { support::child(&self.syntax) }
#[inline]
pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) }
#[inline]
pub fn mod_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![mod]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct Name {
pub(crate) syntax: SyntaxNode,
}
impl Name {
#[inline]
pub fn ident_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![ident]) }
#[inline]
pub fn self_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![self]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct NameRef {
pub(crate) syntax: SyntaxNode,
}
impl NameRef {
#[inline]
pub fn Self_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![Self]) }
#[inline]
pub fn crate_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![crate]) }
#[inline]
pub fn ident_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![ident]) }
#[inline]
pub fn int_number_token(&self) -> Option<SyntaxToken> {
support::token(&self.syntax, T![int_number])
}
#[inline]
pub fn self_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![self]) }
#[inline]
pub fn super_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![super]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct NeverType {
pub(crate) syntax: SyntaxNode,
}
impl NeverType {
#[inline]
pub fn excl_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![!]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct OffsetOfExpr {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for OffsetOfExpr {}
impl OffsetOfExpr {
#[inline]
pub fn fields(&self) -> AstChildren<NameRef> { support::children(&self.syntax) }
#[inline]
pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) }
#[inline]
pub fn pound_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![#]) }
#[inline]
pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['(']) }
#[inline]
pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) }
#[inline]
pub fn comma_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![,]) }
#[inline]
pub fn builtin_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![builtin]) }
#[inline]
pub fn offset_of_token(&self) -> Option<SyntaxToken> {
support::token(&self.syntax, T![offset_of])
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct OrPat {
pub(crate) syntax: SyntaxNode,
}
impl OrPat {
#[inline]
pub fn pats(&self) -> AstChildren<Pat> { support::children(&self.syntax) }
#[inline]
pub fn pipe_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![|]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct Param {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for Param {}
impl Param {
#[inline]
pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) }
#[inline]
pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) }
#[inline]
pub fn dotdotdot_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![...]) }
#[inline]
pub fn colon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![:]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct ParamList {
pub(crate) syntax: SyntaxNode,
}
impl ParamList {
#[inline]
pub fn params(&self) -> AstChildren<Param> { support::children(&self.syntax) }
#[inline]
pub fn self_param(&self) -> Option<SelfParam> { support::child(&self.syntax) }
#[inline]
pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['(']) }
#[inline]
pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) }
#[inline]
pub fn comma_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![,]) }
#[inline]
pub fn pipe_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![|]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct ParenExpr {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for ParenExpr {}
impl ParenExpr {
#[inline]
pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
#[inline]
pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['(']) }
#[inline]
pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct ParenPat {
pub(crate) syntax: SyntaxNode,
}
impl ParenPat {
#[inline]
pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) }
#[inline]
pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['(']) }
#[inline]
pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct ParenType {
pub(crate) syntax: SyntaxNode,
}
impl ParenType {
#[inline]
pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) }
#[inline]
pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['(']) }
#[inline]
pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct ParenthesizedArgList {
pub(crate) syntax: SyntaxNode,
}
impl ParenthesizedArgList {
#[inline]
pub fn type_args(&self) -> AstChildren<TypeArg> { support::children(&self.syntax) }
#[inline]
pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['(']) }
#[inline]
pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) }
#[inline]
pub fn coloncolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![::]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct Path {
pub(crate) syntax: SyntaxNode,
}
impl Path {
#[inline]
pub fn qualifier(&self) -> Option<Path> { support::child(&self.syntax) }
#[inline]
pub fn segment(&self) -> Option<PathSegment> { support::child(&self.syntax) }
#[inline]
pub fn coloncolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![::]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct PathExpr {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for PathExpr {}
impl PathExpr {
#[inline]
pub fn path(&self) -> Option<Path> { support::child(&self.syntax) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct PathPat {
pub(crate) syntax: SyntaxNode,
}
impl PathPat {
#[inline]
pub fn path(&self) -> Option<Path> { support::child(&self.syntax) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct PathSegment {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasGenericArgs for PathSegment {}
impl PathSegment {
#[inline]
pub fn name_ref(&self) -> Option<NameRef> { support::child(&self.syntax) }
#[inline]
pub fn parenthesized_arg_list(&self) -> Option<ParenthesizedArgList> {
support::child(&self.syntax)
}
#[inline]
pub fn path_type(&self) -> Option<PathType> { support::child(&self.syntax) }
#[inline]
pub fn ret_type(&self) -> Option<RetType> { support::child(&self.syntax) }
#[inline]
pub fn return_type_syntax(&self) -> Option<ReturnTypeSyntax> { support::child(&self.syntax) }
#[inline]
pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) }
#[inline]
pub fn coloncolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![::]) }
#[inline]
pub fn l_angle_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![<]) }
#[inline]
pub fn r_angle_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![>]) }
#[inline]
pub fn as_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![as]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct PathType {
pub(crate) syntax: SyntaxNode,
}
impl PathType {
#[inline]
pub fn path(&self) -> Option<Path> { support::child(&self.syntax) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct PrefixExpr {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for PrefixExpr {}
impl PrefixExpr {
#[inline]
pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct PtrType {
pub(crate) syntax: SyntaxNode,
}
impl PtrType {
#[inline]
pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) }
#[inline]
pub fn star_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![*]) }
#[inline]
pub fn const_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![const]) }
#[inline]
pub fn mut_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![mut]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct RangeExpr {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for RangeExpr {}
impl RangeExpr {}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct RangePat {
pub(crate) syntax: SyntaxNode,
}
impl RangePat {}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct RecordExpr {
pub(crate) syntax: SyntaxNode,
}
impl RecordExpr {
#[inline]
pub fn path(&self) -> Option<Path> { support::child(&self.syntax) }
#[inline]
pub fn record_expr_field_list(&self) -> Option<RecordExprFieldList> {
support::child(&self.syntax)
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct RecordExprField {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for RecordExprField {}
impl RecordExprField {
#[inline]
pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
#[inline]
pub fn name_ref(&self) -> Option<NameRef> { support::child(&self.syntax) }
#[inline]
pub fn colon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![:]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct RecordExprFieldList {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for RecordExprFieldList {}
impl RecordExprFieldList {
#[inline]
pub fn fields(&self) -> AstChildren<RecordExprField> { support::children(&self.syntax) }
#[inline]
pub fn spread(&self) -> Option<Expr> { support::child(&self.syntax) }
#[inline]
pub fn l_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['{']) }
#[inline]
pub fn r_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['}']) }
#[inline]
pub fn dotdot_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![..]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct RecordField {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for RecordField {}
impl ast::HasDocComments for RecordField {}
impl ast::HasName for RecordField {}
impl ast::HasVisibility for RecordField {}
impl RecordField {
#[inline]
pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) }
#[inline]
pub fn colon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![:]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct RecordFieldList {
pub(crate) syntax: SyntaxNode,
}
impl RecordFieldList {
#[inline]
pub fn fields(&self) -> AstChildren<RecordField> { support::children(&self.syntax) }
#[inline]
pub fn l_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['{']) }
#[inline]
pub fn r_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['}']) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct RecordPat {
pub(crate) syntax: SyntaxNode,
}
impl RecordPat {
#[inline]
pub fn path(&self) -> Option<Path> { support::child(&self.syntax) }
#[inline]
pub fn record_pat_field_list(&self) -> Option<RecordPatFieldList> {
support::child(&self.syntax)
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct RecordPatField {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for RecordPatField {}
impl RecordPatField {
#[inline]
pub fn name_ref(&self) -> Option<NameRef> { support::child(&self.syntax) }
#[inline]
pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) }
#[inline]
pub fn colon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![:]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct RecordPatFieldList {
pub(crate) syntax: SyntaxNode,
}
impl RecordPatFieldList {
#[inline]
pub fn fields(&self) -> AstChildren<RecordPatField> { support::children(&self.syntax) }
#[inline]
pub fn rest_pat(&self) -> Option<RestPat> { support::child(&self.syntax) }
#[inline]
pub fn l_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['{']) }
#[inline]
pub fn r_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['}']) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct RefExpr {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for RefExpr {}
impl RefExpr {
#[inline]
pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
#[inline]
pub fn amp_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![&]) }
#[inline]
pub fn const_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![const]) }
#[inline]
pub fn mut_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![mut]) }
#[inline]
pub fn raw_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![raw]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct RefPat {
pub(crate) syntax: SyntaxNode,
}
impl RefPat {
#[inline]
pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) }
#[inline]
pub fn amp_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![&]) }
#[inline]
pub fn mut_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![mut]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct RefType {
pub(crate) syntax: SyntaxNode,
}
impl RefType {
#[inline]
pub fn lifetime(&self) -> Option<Lifetime> { support::child(&self.syntax) }
#[inline]
pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) }
#[inline]
pub fn amp_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![&]) }
#[inline]
pub fn mut_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![mut]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct Rename {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasName for Rename {}
impl Rename {
#[inline]
pub fn underscore_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![_]) }
#[inline]
pub fn as_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![as]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct RestPat {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for RestPat {}
impl RestPat {
#[inline]
pub fn dotdot_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![..]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct RetType {
pub(crate) syntax: SyntaxNode,
}
impl RetType {
#[inline]
pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) }
#[inline]
pub fn thin_arrow_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![->]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct ReturnExpr {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for ReturnExpr {}
impl ReturnExpr {
#[inline]
pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
#[inline]
pub fn return_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![return]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct ReturnTypeSyntax {
pub(crate) syntax: SyntaxNode,
}
impl ReturnTypeSyntax {
#[inline]
pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['(']) }
#[inline]
pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) }
#[inline]
pub fn dotdot_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![..]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct SelfParam {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for SelfParam {}
impl ast::HasName for SelfParam {}
impl SelfParam {
#[inline]
pub fn lifetime(&self) -> Option<Lifetime> { support::child(&self.syntax) }
#[inline]
pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) }
#[inline]
pub fn amp_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![&]) }
#[inline]
pub fn colon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![:]) }
#[inline]
pub fn mut_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![mut]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct SlicePat {
pub(crate) syntax: SyntaxNode,
}
impl SlicePat {
#[inline]
pub fn pats(&self) -> AstChildren<Pat> { support::children(&self.syntax) }
#[inline]
pub fn l_brack_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['[']) }
#[inline]
pub fn r_brack_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![']']) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct SliceType {
pub(crate) syntax: SyntaxNode,
}
impl SliceType {
#[inline]
pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) }
#[inline]
pub fn l_brack_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['[']) }
#[inline]
pub fn r_brack_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![']']) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct SourceFile {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for SourceFile {}
impl ast::HasDocComments for SourceFile {}
impl ast::HasModuleItem for SourceFile {}
impl SourceFile {
#[inline]
pub fn shebang_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![shebang]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct Static {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for Static {}
impl ast::HasDocComments for Static {}
impl ast::HasName for Static {}
impl ast::HasVisibility for Static {}
impl Static {
#[inline]
pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) }
#[inline]
pub fn colon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![:]) }
#[inline]
pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) }
#[inline]
pub fn eq_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=]) }
#[inline]
pub fn mut_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![mut]) }
#[inline]
pub fn safe_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![safe]) }
#[inline]
pub fn static_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![static]) }
#[inline]
pub fn unsafe_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![unsafe]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct StmtList {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for StmtList {}
impl StmtList {
#[inline]
pub fn statements(&self) -> AstChildren<Stmt> { support::children(&self.syntax) }
#[inline]
pub fn tail_expr(&self) -> Option<Expr> { support::child(&self.syntax) }
#[inline]
pub fn l_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['{']) }
#[inline]
pub fn r_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['}']) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct Struct {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for Struct {}
impl ast::HasDocComments for Struct {}
impl ast::HasGenericParams for Struct {}
impl ast::HasName for Struct {}
impl ast::HasVisibility for Struct {}
impl Struct {
#[inline]
pub fn field_list(&self) -> Option<FieldList> { support::child(&self.syntax) }
#[inline]
pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) }
#[inline]
pub fn struct_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![struct]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct TokenTree {
pub(crate) syntax: SyntaxNode,
}
impl TokenTree {
#[inline]
pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['(']) }
#[inline]
pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) }
#[inline]
pub fn l_brack_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['[']) }
#[inline]
pub fn r_brack_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![']']) }
#[inline]
pub fn l_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['{']) }
#[inline]
pub fn r_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['}']) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct Trait {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for Trait {}
impl ast::HasDocComments for Trait {}
impl ast::HasGenericParams for Trait {}
impl ast::HasName for Trait {}
impl ast::HasTypeBounds for Trait {}
impl ast::HasVisibility for Trait {}
impl Trait {
#[inline]
pub fn assoc_item_list(&self) -> Option<AssocItemList> { support::child(&self.syntax) }
#[inline]
pub fn auto_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![auto]) }
#[inline]
pub fn trait_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![trait]) }
#[inline]
pub fn unsafe_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![unsafe]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct TraitAlias {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for TraitAlias {}
impl ast::HasDocComments for TraitAlias {}
impl ast::HasGenericParams for TraitAlias {}
impl ast::HasName for TraitAlias {}
impl ast::HasVisibility for TraitAlias {}
impl TraitAlias {
#[inline]
pub fn type_bound_list(&self) -> Option<TypeBoundList> { support::child(&self.syntax) }
#[inline]
pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) }
#[inline]
pub fn eq_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=]) }
#[inline]
pub fn trait_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![trait]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct TryExpr {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for TryExpr {}
impl TryExpr {
#[inline]
pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
#[inline]
pub fn question_mark_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![?]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct TupleExpr {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for TupleExpr {}
impl TupleExpr {
#[inline]
pub fn fields(&self) -> AstChildren<Expr> { support::children(&self.syntax) }
#[inline]
pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['(']) }
#[inline]
pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct TupleField {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for TupleField {}
impl ast::HasDocComments for TupleField {}
impl ast::HasVisibility for TupleField {}
impl TupleField {
#[inline]
pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct TupleFieldList {
pub(crate) syntax: SyntaxNode,
}
impl TupleFieldList {
#[inline]
pub fn fields(&self) -> AstChildren<TupleField> { support::children(&self.syntax) }
#[inline]
pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['(']) }
#[inline]
pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct TuplePat {
pub(crate) syntax: SyntaxNode,
}
impl TuplePat {
#[inline]
pub fn fields(&self) -> AstChildren<Pat> { support::children(&self.syntax) }
#[inline]
pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['(']) }
#[inline]
pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct TupleStructPat {
pub(crate) syntax: SyntaxNode,
}
impl TupleStructPat {
#[inline]
pub fn fields(&self) -> AstChildren<Pat> { support::children(&self.syntax) }
#[inline]
pub fn path(&self) -> Option<Path> { support::child(&self.syntax) }
#[inline]
pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['(']) }
#[inline]
pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct TupleType {
pub(crate) syntax: SyntaxNode,
}
impl TupleType {
#[inline]
pub fn fields(&self) -> AstChildren<Type> { support::children(&self.syntax) }
#[inline]
pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['(']) }
#[inline]
pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct TypeAlias {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for TypeAlias {}
impl ast::HasDocComments for TypeAlias {}
impl ast::HasGenericParams for TypeAlias {}
impl ast::HasName for TypeAlias {}
impl ast::HasTypeBounds for TypeAlias {}
impl ast::HasVisibility for TypeAlias {}
impl TypeAlias {
#[inline]
pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) }
#[inline]
pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) }
#[inline]
pub fn eq_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=]) }
#[inline]
pub fn default_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![default]) }
#[inline]
pub fn type_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![type]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct TypeArg {
pub(crate) syntax: SyntaxNode,
}
impl TypeArg {
#[inline]
pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct TypeBound {
pub(crate) syntax: SyntaxNode,
}
impl TypeBound {
#[inline]
pub fn lifetime(&self) -> Option<Lifetime> { support::child(&self.syntax) }
#[inline]
pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) }
#[inline]
pub fn use_bound_generic_args(&self) -> Option<UseBoundGenericArgs> {
support::child(&self.syntax)
}
#[inline]
pub fn question_mark_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![?]) }
#[inline]
pub fn async_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![async]) }
#[inline]
pub fn const_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![const]) }
#[inline]
pub fn use_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![use]) }
#[inline]
pub fn tilde_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![~]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct TypeBoundList {
pub(crate) syntax: SyntaxNode,
}
impl TypeBoundList {
#[inline]
pub fn bounds(&self) -> AstChildren<TypeBound> { support::children(&self.syntax) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct TypeParam {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for TypeParam {}
impl ast::HasName for TypeParam {}
impl ast::HasTypeBounds for TypeParam {}
impl TypeParam {
#[inline]
pub fn default_type(&self) -> Option<Type> { support::child(&self.syntax) }
#[inline]
pub fn eq_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct UnderscoreExpr {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for UnderscoreExpr {}
impl UnderscoreExpr {
#[inline]
pub fn underscore_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![_]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct Union {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for Union {}
impl ast::HasDocComments for Union {}
impl ast::HasGenericParams for Union {}
impl ast::HasName for Union {}
impl ast::HasVisibility for Union {}
impl Union {
#[inline]
pub fn record_field_list(&self) -> Option<RecordFieldList> { support::child(&self.syntax) }
#[inline]
pub fn union_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![union]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct Use {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for Use {}
impl ast::HasDocComments for Use {}
impl ast::HasVisibility for Use {}
impl Use {
#[inline]
pub fn use_tree(&self) -> Option<UseTree> { support::child(&self.syntax) }
#[inline]
pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) }
#[inline]
pub fn use_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![use]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct UseBoundGenericArgs {
pub(crate) syntax: SyntaxNode,
}
impl UseBoundGenericArgs {
#[inline]
pub fn use_bound_generic_args(&self) -> AstChildren<UseBoundGenericArg> {
support::children(&self.syntax)
}
#[inline]
pub fn l_angle_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![<]) }
#[inline]
pub fn r_angle_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![>]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct UseTree {
pub(crate) syntax: SyntaxNode,
}
impl UseTree {
#[inline]
pub fn path(&self) -> Option<Path> { support::child(&self.syntax) }
#[inline]
pub fn rename(&self) -> Option<Rename> { support::child(&self.syntax) }
#[inline]
pub fn use_tree_list(&self) -> Option<UseTreeList> { support::child(&self.syntax) }
#[inline]
pub fn star_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![*]) }
#[inline]
pub fn coloncolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![::]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct UseTreeList {
pub(crate) syntax: SyntaxNode,
}
impl UseTreeList {
#[inline]
pub fn use_trees(&self) -> AstChildren<UseTree> { support::children(&self.syntax) }
#[inline]
pub fn l_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['{']) }
#[inline]
pub fn r_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['}']) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct Variant {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for Variant {}
impl ast::HasDocComments for Variant {}
impl ast::HasName for Variant {}
impl ast::HasVisibility for Variant {}
impl Variant {
#[inline]
pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
#[inline]
pub fn field_list(&self) -> Option<FieldList> { support::child(&self.syntax) }
#[inline]
pub fn eq_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct VariantList {
pub(crate) syntax: SyntaxNode,
}
impl VariantList {
#[inline]
pub fn variants(&self) -> AstChildren<Variant> { support::children(&self.syntax) }
#[inline]
pub fn l_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['{']) }
#[inline]
pub fn r_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['}']) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct Visibility {
pub(crate) syntax: SyntaxNode,
}
impl Visibility {
#[inline]
pub fn path(&self) -> Option<Path> { support::child(&self.syntax) }
#[inline]
pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['(']) }
#[inline]
pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) }
#[inline]
pub fn in_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![in]) }
#[inline]
pub fn pub_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![pub]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct WhereClause {
pub(crate) syntax: SyntaxNode,
}
impl WhereClause {
#[inline]
pub fn predicates(&self) -> AstChildren<WherePred> { support::children(&self.syntax) }
#[inline]
pub fn where_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![where]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct WherePred {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasTypeBounds for WherePred {}
impl WherePred {
#[inline]
pub fn generic_param_list(&self) -> Option<GenericParamList> { support::child(&self.syntax) }
#[inline]
pub fn lifetime(&self) -> Option<Lifetime> { support::child(&self.syntax) }
#[inline]
pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) }
#[inline]
pub fn for_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![for]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct WhileExpr {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for WhileExpr {}
impl WhileExpr {
#[inline]
pub fn while_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![while]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct WildcardPat {
pub(crate) syntax: SyntaxNode,
}
impl WildcardPat {
#[inline]
pub fn underscore_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![_]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct YeetExpr {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for YeetExpr {}
impl YeetExpr {
#[inline]
pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
#[inline]
pub fn do_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![do]) }
#[inline]
pub fn yeet_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![yeet]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct YieldExpr {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for YieldExpr {}
impl YieldExpr {
#[inline]
pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
#[inline]
pub fn yield_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![yield]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum Adt {
Enum(Enum),
Struct(Struct),
Union(Union),
}
impl ast::HasAttrs for Adt {}
impl ast::HasDocComments for Adt {}
impl ast::HasGenericParams for Adt {}
impl ast::HasName for Adt {}
impl ast::HasVisibility for Adt {}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum AsmOperand {
AsmConst(AsmConst),
AsmLabel(AsmLabel),
AsmRegOperand(AsmRegOperand),
AsmSym(AsmSym),
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum AsmPiece {
AsmClobberAbi(AsmClobberAbi),
AsmOperandNamed(AsmOperandNamed),
AsmOptions(AsmOptions),
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum AssocItem {
Const(Const),
Fn(Fn),
MacroCall(MacroCall),
TypeAlias(TypeAlias),
}
impl ast::HasAttrs for AssocItem {}
impl ast::HasDocComments for AssocItem {}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum Expr {
ArrayExpr(ArrayExpr),
AsmExpr(AsmExpr),
AwaitExpr(AwaitExpr),
BecomeExpr(BecomeExpr),
BinExpr(BinExpr),
BlockExpr(BlockExpr),
BreakExpr(BreakExpr),
CallExpr(CallExpr),
CastExpr(CastExpr),
ClosureExpr(ClosureExpr),
ContinueExpr(ContinueExpr),
FieldExpr(FieldExpr),
ForExpr(ForExpr),
FormatArgsExpr(FormatArgsExpr),
IfExpr(IfExpr),
IndexExpr(IndexExpr),
LetExpr(LetExpr),
Literal(Literal),
LoopExpr(LoopExpr),
MacroExpr(MacroExpr),
MatchExpr(MatchExpr),
MethodCallExpr(MethodCallExpr),
OffsetOfExpr(OffsetOfExpr),
ParenExpr(ParenExpr),
PathExpr(PathExpr),
PrefixExpr(PrefixExpr),
RangeExpr(RangeExpr),
RecordExpr(RecordExpr),
RefExpr(RefExpr),
ReturnExpr(ReturnExpr),
TryExpr(TryExpr),
TupleExpr(TupleExpr),
UnderscoreExpr(UnderscoreExpr),
WhileExpr(WhileExpr),
YeetExpr(YeetExpr),
YieldExpr(YieldExpr),
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum ExternItem {
Fn(Fn),
MacroCall(MacroCall),
Static(Static),
TypeAlias(TypeAlias),
}
impl ast::HasAttrs for ExternItem {}
impl ast::HasDocComments for ExternItem {}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum FieldList {
RecordFieldList(RecordFieldList),
TupleFieldList(TupleFieldList),
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum GenericArg {
AssocTypeArg(AssocTypeArg),
ConstArg(ConstArg),
LifetimeArg(LifetimeArg),
TypeArg(TypeArg),
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum GenericParam {
ConstParam(ConstParam),
LifetimeParam(LifetimeParam),
TypeParam(TypeParam),
}
impl ast::HasAttrs for GenericParam {}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum Item {
Const(Const),
Enum(Enum),
ExternBlock(ExternBlock),
ExternCrate(ExternCrate),
Fn(Fn),
Impl(Impl),
MacroCall(MacroCall),
MacroDef(MacroDef),
MacroRules(MacroRules),
Module(Module),
Static(Static),
Struct(Struct),
Trait(Trait),
TraitAlias(TraitAlias),
TypeAlias(TypeAlias),
Union(Union),
Use(Use),
}
impl ast::HasAttrs for Item {}
impl ast::HasDocComments for Item {}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum Pat {
BoxPat(BoxPat),
ConstBlockPat(ConstBlockPat),
IdentPat(IdentPat),
LiteralPat(LiteralPat),
MacroPat(MacroPat),
OrPat(OrPat),
ParenPat(ParenPat),
PathPat(PathPat),
RangePat(RangePat),
RecordPat(RecordPat),
RefPat(RefPat),
RestPat(RestPat),
SlicePat(SlicePat),
TuplePat(TuplePat),
TupleStructPat(TupleStructPat),
WildcardPat(WildcardPat),
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum Stmt {
ExprStmt(ExprStmt),
Item(Item),
LetStmt(LetStmt),
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum Type {
ArrayType(ArrayType),
DynTraitType(DynTraitType),
FnPtrType(FnPtrType),
ForType(ForType),
ImplTraitType(ImplTraitType),
InferType(InferType),
MacroType(MacroType),
NeverType(NeverType),
ParenType(ParenType),
PathType(PathType),
PtrType(PtrType),
RefType(RefType),
SliceType(SliceType),
TupleType(TupleType),
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum UseBoundGenericArg {
Lifetime(Lifetime),
NameRef(NameRef),
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct AnyHasArgList {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasArgList for AnyHasArgList {}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct AnyHasAttrs {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for AnyHasAttrs {}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct AnyHasDocComments {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasDocComments for AnyHasDocComments {}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct AnyHasGenericArgs {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasGenericArgs for AnyHasGenericArgs {}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct AnyHasGenericParams {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasGenericParams for AnyHasGenericParams {}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct AnyHasLoopBody {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasLoopBody for AnyHasLoopBody {}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct AnyHasModuleItem {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasModuleItem for AnyHasModuleItem {}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct AnyHasName {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasName for AnyHasName {}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct AnyHasTypeBounds {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasTypeBounds for AnyHasTypeBounds {}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct AnyHasVisibility {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasVisibility for AnyHasVisibility {}
impl AstNode for Abi {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == ABI }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for ArgList {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == ARG_LIST }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for ArrayExpr {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == ARRAY_EXPR }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for ArrayType {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == ARRAY_TYPE }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for AsmClobberAbi {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == ASM_CLOBBER_ABI }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for AsmConst {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == ASM_CONST }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for AsmDirSpec {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == ASM_DIR_SPEC }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for AsmExpr {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == ASM_EXPR }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for AsmLabel {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == ASM_LABEL }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for AsmOperandExpr {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == ASM_OPERAND_EXPR }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for AsmOperandNamed {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == ASM_OPERAND_NAMED }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for AsmOption {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == ASM_OPTION }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for AsmOptions {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == ASM_OPTIONS }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for AsmRegOperand {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == ASM_REG_OPERAND }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for AsmRegSpec {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == ASM_REG_SPEC }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for AsmSym {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == ASM_SYM }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for AssocItemList {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == ASSOC_ITEM_LIST }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for AssocTypeArg {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == ASSOC_TYPE_ARG }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for Attr {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == ATTR }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for AwaitExpr {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == AWAIT_EXPR }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for BecomeExpr {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == BECOME_EXPR }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for BinExpr {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == BIN_EXPR }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for BlockExpr {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == BLOCK_EXPR }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for BoxPat {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == BOX_PAT }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for BreakExpr {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == BREAK_EXPR }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for CallExpr {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == CALL_EXPR }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for CastExpr {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == CAST_EXPR }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for ClosureBinder {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == CLOSURE_BINDER }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for ClosureExpr {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == CLOSURE_EXPR }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for Const {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == CONST }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for ConstArg {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == CONST_ARG }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for ConstBlockPat {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == CONST_BLOCK_PAT }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for ConstParam {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == CONST_PARAM }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for ContinueExpr {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == CONTINUE_EXPR }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for DynTraitType {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == DYN_TRAIT_TYPE }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for Enum {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == ENUM }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for ExprStmt {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == EXPR_STMT }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for ExternBlock {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == EXTERN_BLOCK }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for ExternCrate {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == EXTERN_CRATE }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for ExternItemList {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == EXTERN_ITEM_LIST }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for FieldExpr {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == FIELD_EXPR }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for Fn {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == FN }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for FnPtrType {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == FN_PTR_TYPE }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for ForExpr {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == FOR_EXPR }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for ForType {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == FOR_TYPE }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for FormatArgsArg {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == FORMAT_ARGS_ARG }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for FormatArgsExpr {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == FORMAT_ARGS_EXPR }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for GenericArgList {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == GENERIC_ARG_LIST }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for GenericParamList {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == GENERIC_PARAM_LIST }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for IdentPat {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == IDENT_PAT }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for IfExpr {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == IF_EXPR }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for Impl {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == IMPL }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for ImplTraitType {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == IMPL_TRAIT_TYPE }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for IndexExpr {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == INDEX_EXPR }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for InferType {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == INFER_TYPE }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for ItemList {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == ITEM_LIST }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for Label {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == LABEL }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for LetElse {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == LET_ELSE }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for LetExpr {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == LET_EXPR }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for LetStmt {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == LET_STMT }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for Lifetime {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == LIFETIME }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for LifetimeArg {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == LIFETIME_ARG }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for LifetimeParam {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == LIFETIME_PARAM }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for Literal {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == LITERAL }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for LiteralPat {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == LITERAL_PAT }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for LoopExpr {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == LOOP_EXPR }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for MacroCall {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == MACRO_CALL }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for MacroDef {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == MACRO_DEF }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for MacroExpr {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == MACRO_EXPR }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for MacroItems {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == MACRO_ITEMS }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for MacroPat {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == MACRO_PAT }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for MacroRules {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == MACRO_RULES }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for MacroStmts {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == MACRO_STMTS }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for MacroType {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == MACRO_TYPE }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for MatchArm {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == MATCH_ARM }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for MatchArmList {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == MATCH_ARM_LIST }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for MatchExpr {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == MATCH_EXPR }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for MatchGuard {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == MATCH_GUARD }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for Meta {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == META }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for MethodCallExpr {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == METHOD_CALL_EXPR }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for Module {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == MODULE }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for Name {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == NAME }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for NameRef {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == NAME_REF }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for NeverType {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == NEVER_TYPE }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for OffsetOfExpr {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == OFFSET_OF_EXPR }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for OrPat {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == OR_PAT }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for Param {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == PARAM }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for ParamList {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == PARAM_LIST }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for ParenExpr {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == PAREN_EXPR }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for ParenPat {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == PAREN_PAT }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for ParenType {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == PAREN_TYPE }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for ParenthesizedArgList {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == PARENTHESIZED_ARG_LIST }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for Path {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == PATH }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for PathExpr {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == PATH_EXPR }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for PathPat {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == PATH_PAT }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for PathSegment {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == PATH_SEGMENT }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for PathType {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == PATH_TYPE }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for PrefixExpr {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == PREFIX_EXPR }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for PtrType {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == PTR_TYPE }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for RangeExpr {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == RANGE_EXPR }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for RangePat {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == RANGE_PAT }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for RecordExpr {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == RECORD_EXPR }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for RecordExprField {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == RECORD_EXPR_FIELD }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for RecordExprFieldList {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == RECORD_EXPR_FIELD_LIST }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for RecordField {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == RECORD_FIELD }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for RecordFieldList {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == RECORD_FIELD_LIST }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for RecordPat {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == RECORD_PAT }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for RecordPatField {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == RECORD_PAT_FIELD }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for RecordPatFieldList {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == RECORD_PAT_FIELD_LIST }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for RefExpr {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == REF_EXPR }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for RefPat {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == REF_PAT }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for RefType {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == REF_TYPE }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for Rename {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == RENAME }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for RestPat {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == REST_PAT }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for RetType {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == RET_TYPE }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for ReturnExpr {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == RETURN_EXPR }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for ReturnTypeSyntax {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == RETURN_TYPE_SYNTAX }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for SelfParam {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == SELF_PARAM }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for SlicePat {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == SLICE_PAT }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for SliceType {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == SLICE_TYPE }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for SourceFile {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == SOURCE_FILE }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for Static {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == STATIC }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for StmtList {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == STMT_LIST }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for Struct {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == STRUCT }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for TokenTree {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == TOKEN_TREE }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for Trait {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == TRAIT }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for TraitAlias {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == TRAIT_ALIAS }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for TryExpr {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == TRY_EXPR }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for TupleExpr {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == TUPLE_EXPR }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for TupleField {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == TUPLE_FIELD }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for TupleFieldList {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == TUPLE_FIELD_LIST }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for TuplePat {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == TUPLE_PAT }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for TupleStructPat {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == TUPLE_STRUCT_PAT }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for TupleType {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == TUPLE_TYPE }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for TypeAlias {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == TYPE_ALIAS }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for TypeArg {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == TYPE_ARG }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for TypeBound {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == TYPE_BOUND }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for TypeBoundList {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == TYPE_BOUND_LIST }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for TypeParam {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == TYPE_PARAM }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for UnderscoreExpr {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == UNDERSCORE_EXPR }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for Union {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == UNION }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for Use {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == USE }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for UseBoundGenericArgs {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == USE_BOUND_GENERIC_ARGS }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for UseTree {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == USE_TREE }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for UseTreeList {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == USE_TREE_LIST }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for Variant {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == VARIANT }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for VariantList {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == VARIANT_LIST }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for Visibility {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == VISIBILITY }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for WhereClause {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == WHERE_CLAUSE }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for WherePred {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == WHERE_PRED }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for WhileExpr {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == WHILE_EXPR }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for WildcardPat {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == WILDCARD_PAT }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for YeetExpr {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == YEET_EXPR }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for YieldExpr {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { kind == YIELD_EXPR }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl From<Enum> for Adt {
#[inline]
fn from(node: Enum) -> Adt { Adt::Enum(node) }
}
impl From<Struct> for Adt {
#[inline]
fn from(node: Struct) -> Adt { Adt::Struct(node) }
}
impl From<Union> for Adt {
#[inline]
fn from(node: Union) -> Adt { Adt::Union(node) }
}
impl AstNode for Adt {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { matches!(kind, ENUM | STRUCT | UNION) }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
let res = match syntax.kind() {
ENUM => Adt::Enum(Enum { syntax }),
STRUCT => Adt::Struct(Struct { syntax }),
UNION => Adt::Union(Union { syntax }),
_ => return None,
};
Some(res)
}
#[inline]
fn syntax(&self) -> &SyntaxNode {
match self {
Adt::Enum(it) => &it.syntax,
Adt::Struct(it) => &it.syntax,
Adt::Union(it) => &it.syntax,
}
}
}
impl From<AsmConst> for AsmOperand {
#[inline]
fn from(node: AsmConst) -> AsmOperand { AsmOperand::AsmConst(node) }
}
impl From<AsmLabel> for AsmOperand {
#[inline]
fn from(node: AsmLabel) -> AsmOperand { AsmOperand::AsmLabel(node) }
}
impl From<AsmRegOperand> for AsmOperand {
#[inline]
fn from(node: AsmRegOperand) -> AsmOperand { AsmOperand::AsmRegOperand(node) }
}
impl From<AsmSym> for AsmOperand {
#[inline]
fn from(node: AsmSym) -> AsmOperand { AsmOperand::AsmSym(node) }
}
impl AstNode for AsmOperand {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool {
matches!(kind, ASM_CONST | ASM_LABEL | ASM_REG_OPERAND | ASM_SYM)
}
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
let res = match syntax.kind() {
ASM_CONST => AsmOperand::AsmConst(AsmConst { syntax }),
ASM_LABEL => AsmOperand::AsmLabel(AsmLabel { syntax }),
ASM_REG_OPERAND => AsmOperand::AsmRegOperand(AsmRegOperand { syntax }),
ASM_SYM => AsmOperand::AsmSym(AsmSym { syntax }),
_ => return None,
};
Some(res)
}
#[inline]
fn syntax(&self) -> &SyntaxNode {
match self {
AsmOperand::AsmConst(it) => &it.syntax,
AsmOperand::AsmLabel(it) => &it.syntax,
AsmOperand::AsmRegOperand(it) => &it.syntax,
AsmOperand::AsmSym(it) => &it.syntax,
}
}
}
impl From<AsmClobberAbi> for AsmPiece {
#[inline]
fn from(node: AsmClobberAbi) -> AsmPiece { AsmPiece::AsmClobberAbi(node) }
}
impl From<AsmOperandNamed> for AsmPiece {
#[inline]
fn from(node: AsmOperandNamed) -> AsmPiece { AsmPiece::AsmOperandNamed(node) }
}
impl From<AsmOptions> for AsmPiece {
#[inline]
fn from(node: AsmOptions) -> AsmPiece { AsmPiece::AsmOptions(node) }
}
impl AstNode for AsmPiece {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool {
matches!(kind, ASM_CLOBBER_ABI | ASM_OPERAND_NAMED | ASM_OPTIONS)
}
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
let res = match syntax.kind() {
ASM_CLOBBER_ABI => AsmPiece::AsmClobberAbi(AsmClobberAbi { syntax }),
ASM_OPERAND_NAMED => AsmPiece::AsmOperandNamed(AsmOperandNamed { syntax }),
ASM_OPTIONS => AsmPiece::AsmOptions(AsmOptions { syntax }),
_ => return None,
};
Some(res)
}
#[inline]
fn syntax(&self) -> &SyntaxNode {
match self {
AsmPiece::AsmClobberAbi(it) => &it.syntax,
AsmPiece::AsmOperandNamed(it) => &it.syntax,
AsmPiece::AsmOptions(it) => &it.syntax,
}
}
}
impl From<Const> for AssocItem {
#[inline]
fn from(node: Const) -> AssocItem { AssocItem::Const(node) }
}
impl From<Fn> for AssocItem {
#[inline]
fn from(node: Fn) -> AssocItem { AssocItem::Fn(node) }
}
impl From<MacroCall> for AssocItem {
#[inline]
fn from(node: MacroCall) -> AssocItem { AssocItem::MacroCall(node) }
}
impl From<TypeAlias> for AssocItem {
#[inline]
fn from(node: TypeAlias) -> AssocItem { AssocItem::TypeAlias(node) }
}
impl AstNode for AssocItem {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { matches!(kind, CONST | FN | MACRO_CALL | TYPE_ALIAS) }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
let res = match syntax.kind() {
CONST => AssocItem::Const(Const { syntax }),
FN => AssocItem::Fn(Fn { syntax }),
MACRO_CALL => AssocItem::MacroCall(MacroCall { syntax }),
TYPE_ALIAS => AssocItem::TypeAlias(TypeAlias { syntax }),
_ => return None,
};
Some(res)
}
#[inline]
fn syntax(&self) -> &SyntaxNode {
match self {
AssocItem::Const(it) => &it.syntax,
AssocItem::Fn(it) => &it.syntax,
AssocItem::MacroCall(it) => &it.syntax,
AssocItem::TypeAlias(it) => &it.syntax,
}
}
}
impl From<ArrayExpr> for Expr {
#[inline]
fn from(node: ArrayExpr) -> Expr { Expr::ArrayExpr(node) }
}
impl From<AsmExpr> for Expr {
#[inline]
fn from(node: AsmExpr) -> Expr { Expr::AsmExpr(node) }
}
impl From<AwaitExpr> for Expr {
#[inline]
fn from(node: AwaitExpr) -> Expr { Expr::AwaitExpr(node) }
}
impl From<BecomeExpr> for Expr {
#[inline]
fn from(node: BecomeExpr) -> Expr { Expr::BecomeExpr(node) }
}
impl From<BinExpr> for Expr {
#[inline]
fn from(node: BinExpr) -> Expr { Expr::BinExpr(node) }
}
impl From<BlockExpr> for Expr {
#[inline]
fn from(node: BlockExpr) -> Expr { Expr::BlockExpr(node) }
}
impl From<BreakExpr> for Expr {
#[inline]
fn from(node: BreakExpr) -> Expr { Expr::BreakExpr(node) }
}
impl From<CallExpr> for Expr {
#[inline]
fn from(node: CallExpr) -> Expr { Expr::CallExpr(node) }
}
impl From<CastExpr> for Expr {
#[inline]
fn from(node: CastExpr) -> Expr { Expr::CastExpr(node) }
}
impl From<ClosureExpr> for Expr {
#[inline]
fn from(node: ClosureExpr) -> Expr { Expr::ClosureExpr(node) }
}
impl From<ContinueExpr> for Expr {
#[inline]
fn from(node: ContinueExpr) -> Expr { Expr::ContinueExpr(node) }
}
impl From<FieldExpr> for Expr {
#[inline]
fn from(node: FieldExpr) -> Expr { Expr::FieldExpr(node) }
}
impl From<ForExpr> for Expr {
#[inline]
fn from(node: ForExpr) -> Expr { Expr::ForExpr(node) }
}
impl From<FormatArgsExpr> for Expr {
#[inline]
fn from(node: FormatArgsExpr) -> Expr { Expr::FormatArgsExpr(node) }
}
impl From<IfExpr> for Expr {
#[inline]
fn from(node: IfExpr) -> Expr { Expr::IfExpr(node) }
}
impl From<IndexExpr> for Expr {
#[inline]
fn from(node: IndexExpr) -> Expr { Expr::IndexExpr(node) }
}
impl From<LetExpr> for Expr {
#[inline]
fn from(node: LetExpr) -> Expr { Expr::LetExpr(node) }
}
impl From<Literal> for Expr {
#[inline]
fn from(node: Literal) -> Expr { Expr::Literal(node) }
}
impl From<LoopExpr> for Expr {
#[inline]
fn from(node: LoopExpr) -> Expr { Expr::LoopExpr(node) }
}
impl From<MacroExpr> for Expr {
#[inline]
fn from(node: MacroExpr) -> Expr { Expr::MacroExpr(node) }
}
impl From<MatchExpr> for Expr {
#[inline]
fn from(node: MatchExpr) -> Expr { Expr::MatchExpr(node) }
}
impl From<MethodCallExpr> for Expr {
#[inline]
fn from(node: MethodCallExpr) -> Expr { Expr::MethodCallExpr(node) }
}
impl From<OffsetOfExpr> for Expr {
#[inline]
fn from(node: OffsetOfExpr) -> Expr { Expr::OffsetOfExpr(node) }
}
impl From<ParenExpr> for Expr {
#[inline]
fn from(node: ParenExpr) -> Expr { Expr::ParenExpr(node) }
}
impl From<PathExpr> for Expr {
#[inline]
fn from(node: PathExpr) -> Expr { Expr::PathExpr(node) }
}
impl From<PrefixExpr> for Expr {
#[inline]
fn from(node: PrefixExpr) -> Expr { Expr::PrefixExpr(node) }
}
impl From<RangeExpr> for Expr {
#[inline]
fn from(node: RangeExpr) -> Expr { Expr::RangeExpr(node) }
}
impl From<RecordExpr> for Expr {
#[inline]
fn from(node: RecordExpr) -> Expr { Expr::RecordExpr(node) }
}
impl From<RefExpr> for Expr {
#[inline]
fn from(node: RefExpr) -> Expr { Expr::RefExpr(node) }
}
impl From<ReturnExpr> for Expr {
#[inline]
fn from(node: ReturnExpr) -> Expr { Expr::ReturnExpr(node) }
}
impl From<TryExpr> for Expr {
#[inline]
fn from(node: TryExpr) -> Expr { Expr::TryExpr(node) }
}
impl From<TupleExpr> for Expr {
#[inline]
fn from(node: TupleExpr) -> Expr { Expr::TupleExpr(node) }
}
impl From<UnderscoreExpr> for Expr {
#[inline]
fn from(node: UnderscoreExpr) -> Expr { Expr::UnderscoreExpr(node) }
}
impl From<WhileExpr> for Expr {
#[inline]
fn from(node: WhileExpr) -> Expr { Expr::WhileExpr(node) }
}
impl From<YeetExpr> for Expr {
#[inline]
fn from(node: YeetExpr) -> Expr { Expr::YeetExpr(node) }
}
impl From<YieldExpr> for Expr {
#[inline]
fn from(node: YieldExpr) -> Expr { Expr::YieldExpr(node) }
}
impl AstNode for Expr {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool {
matches!(
kind,
ARRAY_EXPR
| ASM_EXPR
| AWAIT_EXPR
| BECOME_EXPR
| BIN_EXPR
| BLOCK_EXPR
| BREAK_EXPR
| CALL_EXPR
| CAST_EXPR
| CLOSURE_EXPR
| CONTINUE_EXPR
| FIELD_EXPR
| FOR_EXPR
| FORMAT_ARGS_EXPR
| IF_EXPR
| INDEX_EXPR
| LET_EXPR
| LITERAL
| LOOP_EXPR
| MACRO_EXPR
| MATCH_EXPR
| METHOD_CALL_EXPR
| OFFSET_OF_EXPR
| PAREN_EXPR
| PATH_EXPR
| PREFIX_EXPR
| RANGE_EXPR
| RECORD_EXPR
| REF_EXPR
| RETURN_EXPR
| TRY_EXPR
| TUPLE_EXPR
| UNDERSCORE_EXPR
| WHILE_EXPR
| YEET_EXPR
| YIELD_EXPR
)
}
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
let res = match syntax.kind() {
ARRAY_EXPR => Expr::ArrayExpr(ArrayExpr { syntax }),
ASM_EXPR => Expr::AsmExpr(AsmExpr { syntax }),
AWAIT_EXPR => Expr::AwaitExpr(AwaitExpr { syntax }),
BECOME_EXPR => Expr::BecomeExpr(BecomeExpr { syntax }),
BIN_EXPR => Expr::BinExpr(BinExpr { syntax }),
BLOCK_EXPR => Expr::BlockExpr(BlockExpr { syntax }),
BREAK_EXPR => Expr::BreakExpr(BreakExpr { syntax }),
CALL_EXPR => Expr::CallExpr(CallExpr { syntax }),
CAST_EXPR => Expr::CastExpr(CastExpr { syntax }),
CLOSURE_EXPR => Expr::ClosureExpr(ClosureExpr { syntax }),
CONTINUE_EXPR => Expr::ContinueExpr(ContinueExpr { syntax }),
FIELD_EXPR => Expr::FieldExpr(FieldExpr { syntax }),
FOR_EXPR => Expr::ForExpr(ForExpr { syntax }),
FORMAT_ARGS_EXPR => Expr::FormatArgsExpr(FormatArgsExpr { syntax }),
IF_EXPR => Expr::IfExpr(IfExpr { syntax }),
INDEX_EXPR => Expr::IndexExpr(IndexExpr { syntax }),
LET_EXPR => Expr::LetExpr(LetExpr { syntax }),
LITERAL => Expr::Literal(Literal { syntax }),
LOOP_EXPR => Expr::LoopExpr(LoopExpr { syntax }),
MACRO_EXPR => Expr::MacroExpr(MacroExpr { syntax }),
MATCH_EXPR => Expr::MatchExpr(MatchExpr { syntax }),
METHOD_CALL_EXPR => Expr::MethodCallExpr(MethodCallExpr { syntax }),
OFFSET_OF_EXPR => Expr::OffsetOfExpr(OffsetOfExpr { syntax }),
PAREN_EXPR => Expr::ParenExpr(ParenExpr { syntax }),
PATH_EXPR => Expr::PathExpr(PathExpr { syntax }),
PREFIX_EXPR => Expr::PrefixExpr(PrefixExpr { syntax }),
RANGE_EXPR => Expr::RangeExpr(RangeExpr { syntax }),
RECORD_EXPR => Expr::RecordExpr(RecordExpr { syntax }),
REF_EXPR => Expr::RefExpr(RefExpr { syntax }),
RETURN_EXPR => Expr::ReturnExpr(ReturnExpr { syntax }),
TRY_EXPR => Expr::TryExpr(TryExpr { syntax }),
TUPLE_EXPR => Expr::TupleExpr(TupleExpr { syntax }),
UNDERSCORE_EXPR => Expr::UnderscoreExpr(UnderscoreExpr { syntax }),
WHILE_EXPR => Expr::WhileExpr(WhileExpr { syntax }),
YEET_EXPR => Expr::YeetExpr(YeetExpr { syntax }),
YIELD_EXPR => Expr::YieldExpr(YieldExpr { syntax }),
_ => return None,
};
Some(res)
}
#[inline]
fn syntax(&self) -> &SyntaxNode {
match self {
Expr::ArrayExpr(it) => &it.syntax,
Expr::AsmExpr(it) => &it.syntax,
Expr::AwaitExpr(it) => &it.syntax,
Expr::BecomeExpr(it) => &it.syntax,
Expr::BinExpr(it) => &it.syntax,
Expr::BlockExpr(it) => &it.syntax,
Expr::BreakExpr(it) => &it.syntax,
Expr::CallExpr(it) => &it.syntax,
Expr::CastExpr(it) => &it.syntax,
Expr::ClosureExpr(it) => &it.syntax,
Expr::ContinueExpr(it) => &it.syntax,
Expr::FieldExpr(it) => &it.syntax,
Expr::ForExpr(it) => &it.syntax,
Expr::FormatArgsExpr(it) => &it.syntax,
Expr::IfExpr(it) => &it.syntax,
Expr::IndexExpr(it) => &it.syntax,
Expr::LetExpr(it) => &it.syntax,
Expr::Literal(it) => &it.syntax,
Expr::LoopExpr(it) => &it.syntax,
Expr::MacroExpr(it) => &it.syntax,
Expr::MatchExpr(it) => &it.syntax,
Expr::MethodCallExpr(it) => &it.syntax,
Expr::OffsetOfExpr(it) => &it.syntax,
Expr::ParenExpr(it) => &it.syntax,
Expr::PathExpr(it) => &it.syntax,
Expr::PrefixExpr(it) => &it.syntax,
Expr::RangeExpr(it) => &it.syntax,
Expr::RecordExpr(it) => &it.syntax,
Expr::RefExpr(it) => &it.syntax,
Expr::ReturnExpr(it) => &it.syntax,
Expr::TryExpr(it) => &it.syntax,
Expr::TupleExpr(it) => &it.syntax,
Expr::UnderscoreExpr(it) => &it.syntax,
Expr::WhileExpr(it) => &it.syntax,
Expr::YeetExpr(it) => &it.syntax,
Expr::YieldExpr(it) => &it.syntax,
}
}
}
impl From<Fn> for ExternItem {
#[inline]
fn from(node: Fn) -> ExternItem { ExternItem::Fn(node) }
}
impl From<MacroCall> for ExternItem {
#[inline]
fn from(node: MacroCall) -> ExternItem { ExternItem::MacroCall(node) }
}
impl From<Static> for ExternItem {
#[inline]
fn from(node: Static) -> ExternItem { ExternItem::Static(node) }
}
impl From<TypeAlias> for ExternItem {
#[inline]
fn from(node: TypeAlias) -> ExternItem { ExternItem::TypeAlias(node) }
}
impl AstNode for ExternItem {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { matches!(kind, FN | MACRO_CALL | STATIC | TYPE_ALIAS) }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
let res = match syntax.kind() {
FN => ExternItem::Fn(Fn { syntax }),
MACRO_CALL => ExternItem::MacroCall(MacroCall { syntax }),
STATIC => ExternItem::Static(Static { syntax }),
TYPE_ALIAS => ExternItem::TypeAlias(TypeAlias { syntax }),
_ => return None,
};
Some(res)
}
#[inline]
fn syntax(&self) -> &SyntaxNode {
match self {
ExternItem::Fn(it) => &it.syntax,
ExternItem::MacroCall(it) => &it.syntax,
ExternItem::Static(it) => &it.syntax,
ExternItem::TypeAlias(it) => &it.syntax,
}
}
}
impl From<RecordFieldList> for FieldList {
#[inline]
fn from(node: RecordFieldList) -> FieldList { FieldList::RecordFieldList(node) }
}
impl From<TupleFieldList> for FieldList {
#[inline]
fn from(node: TupleFieldList) -> FieldList { FieldList::TupleFieldList(node) }
}
impl AstNode for FieldList {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { matches!(kind, RECORD_FIELD_LIST | TUPLE_FIELD_LIST) }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
let res = match syntax.kind() {
RECORD_FIELD_LIST => FieldList::RecordFieldList(RecordFieldList { syntax }),
TUPLE_FIELD_LIST => FieldList::TupleFieldList(TupleFieldList { syntax }),
_ => return None,
};
Some(res)
}
#[inline]
fn syntax(&self) -> &SyntaxNode {
match self {
FieldList::RecordFieldList(it) => &it.syntax,
FieldList::TupleFieldList(it) => &it.syntax,
}
}
}
impl From<AssocTypeArg> for GenericArg {
#[inline]
fn from(node: AssocTypeArg) -> GenericArg { GenericArg::AssocTypeArg(node) }
}
impl From<ConstArg> for GenericArg {
#[inline]
fn from(node: ConstArg) -> GenericArg { GenericArg::ConstArg(node) }
}
impl From<LifetimeArg> for GenericArg {
#[inline]
fn from(node: LifetimeArg) -> GenericArg { GenericArg::LifetimeArg(node) }
}
impl From<TypeArg> for GenericArg {
#[inline]
fn from(node: TypeArg) -> GenericArg { GenericArg::TypeArg(node) }
}
impl AstNode for GenericArg {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool {
matches!(kind, ASSOC_TYPE_ARG | CONST_ARG | LIFETIME_ARG | TYPE_ARG)
}
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
let res = match syntax.kind() {
ASSOC_TYPE_ARG => GenericArg::AssocTypeArg(AssocTypeArg { syntax }),
CONST_ARG => GenericArg::ConstArg(ConstArg { syntax }),
LIFETIME_ARG => GenericArg::LifetimeArg(LifetimeArg { syntax }),
TYPE_ARG => GenericArg::TypeArg(TypeArg { syntax }),
_ => return None,
};
Some(res)
}
#[inline]
fn syntax(&self) -> &SyntaxNode {
match self {
GenericArg::AssocTypeArg(it) => &it.syntax,
GenericArg::ConstArg(it) => &it.syntax,
GenericArg::LifetimeArg(it) => &it.syntax,
GenericArg::TypeArg(it) => &it.syntax,
}
}
}
impl From<ConstParam> for GenericParam {
#[inline]
fn from(node: ConstParam) -> GenericParam { GenericParam::ConstParam(node) }
}
impl From<LifetimeParam> for GenericParam {
#[inline]
fn from(node: LifetimeParam) -> GenericParam { GenericParam::LifetimeParam(node) }
}
impl From<TypeParam> for GenericParam {
#[inline]
fn from(node: TypeParam) -> GenericParam { GenericParam::TypeParam(node) }
}
impl AstNode for GenericParam {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool {
matches!(kind, CONST_PARAM | LIFETIME_PARAM | TYPE_PARAM)
}
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
let res = match syntax.kind() {
CONST_PARAM => GenericParam::ConstParam(ConstParam { syntax }),
LIFETIME_PARAM => GenericParam::LifetimeParam(LifetimeParam { syntax }),
TYPE_PARAM => GenericParam::TypeParam(TypeParam { syntax }),
_ => return None,
};
Some(res)
}
#[inline]
fn syntax(&self) -> &SyntaxNode {
match self {
GenericParam::ConstParam(it) => &it.syntax,
GenericParam::LifetimeParam(it) => &it.syntax,
GenericParam::TypeParam(it) => &it.syntax,
}
}
}
impl From<Const> for Item {
#[inline]
fn from(node: Const) -> Item { Item::Const(node) }
}
impl From<Enum> for Item {
#[inline]
fn from(node: Enum) -> Item { Item::Enum(node) }
}
impl From<ExternBlock> for Item {
#[inline]
fn from(node: ExternBlock) -> Item { Item::ExternBlock(node) }
}
impl From<ExternCrate> for Item {
#[inline]
fn from(node: ExternCrate) -> Item { Item::ExternCrate(node) }
}
impl From<Fn> for Item {
#[inline]
fn from(node: Fn) -> Item { Item::Fn(node) }
}
impl From<Impl> for Item {
#[inline]
fn from(node: Impl) -> Item { Item::Impl(node) }
}
impl From<MacroCall> for Item {
#[inline]
fn from(node: MacroCall) -> Item { Item::MacroCall(node) }
}
impl From<MacroDef> for Item {
#[inline]
fn from(node: MacroDef) -> Item { Item::MacroDef(node) }
}
impl From<MacroRules> for Item {
#[inline]
fn from(node: MacroRules) -> Item { Item::MacroRules(node) }
}
impl From<Module> for Item {
#[inline]
fn from(node: Module) -> Item { Item::Module(node) }
}
impl From<Static> for Item {
#[inline]
fn from(node: Static) -> Item { Item::Static(node) }
}
impl From<Struct> for Item {
#[inline]
fn from(node: Struct) -> Item { Item::Struct(node) }
}
impl From<Trait> for Item {
#[inline]
fn from(node: Trait) -> Item { Item::Trait(node) }
}
impl From<TraitAlias> for Item {
#[inline]
fn from(node: TraitAlias) -> Item { Item::TraitAlias(node) }
}
impl From<TypeAlias> for Item {
#[inline]
fn from(node: TypeAlias) -> Item { Item::TypeAlias(node) }
}
impl From<Union> for Item {
#[inline]
fn from(node: Union) -> Item { Item::Union(node) }
}
impl From<Use> for Item {
#[inline]
fn from(node: Use) -> Item { Item::Use(node) }
}
impl AstNode for Item {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool {
matches!(
kind,
CONST
| ENUM
| EXTERN_BLOCK
| EXTERN_CRATE
| FN
| IMPL
| MACRO_CALL
| MACRO_DEF
| MACRO_RULES
| MODULE
| STATIC
| STRUCT
| TRAIT
| TRAIT_ALIAS
| TYPE_ALIAS
| UNION
| USE
)
}
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
let res = match syntax.kind() {
CONST => Item::Const(Const { syntax }),
ENUM => Item::Enum(Enum { syntax }),
EXTERN_BLOCK => Item::ExternBlock(ExternBlock { syntax }),
EXTERN_CRATE => Item::ExternCrate(ExternCrate { syntax }),
FN => Item::Fn(Fn { syntax }),
IMPL => Item::Impl(Impl { syntax }),
MACRO_CALL => Item::MacroCall(MacroCall { syntax }),
MACRO_DEF => Item::MacroDef(MacroDef { syntax }),
MACRO_RULES => Item::MacroRules(MacroRules { syntax }),
MODULE => Item::Module(Module { syntax }),
STATIC => Item::Static(Static { syntax }),
STRUCT => Item::Struct(Struct { syntax }),
TRAIT => Item::Trait(Trait { syntax }),
TRAIT_ALIAS => Item::TraitAlias(TraitAlias { syntax }),
TYPE_ALIAS => Item::TypeAlias(TypeAlias { syntax }),
UNION => Item::Union(Union { syntax }),
USE => Item::Use(Use { syntax }),
_ => return None,
};
Some(res)
}
#[inline]
fn syntax(&self) -> &SyntaxNode {
match self {
Item::Const(it) => &it.syntax,
Item::Enum(it) => &it.syntax,
Item::ExternBlock(it) => &it.syntax,
Item::ExternCrate(it) => &it.syntax,
Item::Fn(it) => &it.syntax,
Item::Impl(it) => &it.syntax,
Item::MacroCall(it) => &it.syntax,
Item::MacroDef(it) => &it.syntax,
Item::MacroRules(it) => &it.syntax,
Item::Module(it) => &it.syntax,
Item::Static(it) => &it.syntax,
Item::Struct(it) => &it.syntax,
Item::Trait(it) => &it.syntax,
Item::TraitAlias(it) => &it.syntax,
Item::TypeAlias(it) => &it.syntax,
Item::Union(it) => &it.syntax,
Item::Use(it) => &it.syntax,
}
}
}
impl From<BoxPat> for Pat {
#[inline]
fn from(node: BoxPat) -> Pat { Pat::BoxPat(node) }
}
impl From<ConstBlockPat> for Pat {
#[inline]
fn from(node: ConstBlockPat) -> Pat { Pat::ConstBlockPat(node) }
}
impl From<IdentPat> for Pat {
#[inline]
fn from(node: IdentPat) -> Pat { Pat::IdentPat(node) }
}
impl From<LiteralPat> for Pat {
#[inline]
fn from(node: LiteralPat) -> Pat { Pat::LiteralPat(node) }
}
impl From<MacroPat> for Pat {
#[inline]
fn from(node: MacroPat) -> Pat { Pat::MacroPat(node) }
}
impl From<OrPat> for Pat {
#[inline]
fn from(node: OrPat) -> Pat { Pat::OrPat(node) }
}
impl From<ParenPat> for Pat {
#[inline]
fn from(node: ParenPat) -> Pat { Pat::ParenPat(node) }
}
impl From<PathPat> for Pat {
#[inline]
fn from(node: PathPat) -> Pat { Pat::PathPat(node) }
}
impl From<RangePat> for Pat {
#[inline]
fn from(node: RangePat) -> Pat { Pat::RangePat(node) }
}
impl From<RecordPat> for Pat {
#[inline]
fn from(node: RecordPat) -> Pat { Pat::RecordPat(node) }
}
impl From<RefPat> for Pat {
#[inline]
fn from(node: RefPat) -> Pat { Pat::RefPat(node) }
}
impl From<RestPat> for Pat {
#[inline]
fn from(node: RestPat) -> Pat { Pat::RestPat(node) }
}
impl From<SlicePat> for Pat {
#[inline]
fn from(node: SlicePat) -> Pat { Pat::SlicePat(node) }
}
impl From<TuplePat> for Pat {
#[inline]
fn from(node: TuplePat) -> Pat { Pat::TuplePat(node) }
}
impl From<TupleStructPat> for Pat {
#[inline]
fn from(node: TupleStructPat) -> Pat { Pat::TupleStructPat(node) }
}
impl From<WildcardPat> for Pat {
#[inline]
fn from(node: WildcardPat) -> Pat { Pat::WildcardPat(node) }
}
impl AstNode for Pat {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool {
matches!(
kind,
BOX_PAT
| CONST_BLOCK_PAT
| IDENT_PAT
| LITERAL_PAT
| MACRO_PAT
| OR_PAT
| PAREN_PAT
| PATH_PAT
| RANGE_PAT
| RECORD_PAT
| REF_PAT
| REST_PAT
| SLICE_PAT
| TUPLE_PAT
| TUPLE_STRUCT_PAT
| WILDCARD_PAT
)
}
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
let res = match syntax.kind() {
BOX_PAT => Pat::BoxPat(BoxPat { syntax }),
CONST_BLOCK_PAT => Pat::ConstBlockPat(ConstBlockPat { syntax }),
IDENT_PAT => Pat::IdentPat(IdentPat { syntax }),
LITERAL_PAT => Pat::LiteralPat(LiteralPat { syntax }),
MACRO_PAT => Pat::MacroPat(MacroPat { syntax }),
OR_PAT => Pat::OrPat(OrPat { syntax }),
PAREN_PAT => Pat::ParenPat(ParenPat { syntax }),
PATH_PAT => Pat::PathPat(PathPat { syntax }),
RANGE_PAT => Pat::RangePat(RangePat { syntax }),
RECORD_PAT => Pat::RecordPat(RecordPat { syntax }),
REF_PAT => Pat::RefPat(RefPat { syntax }),
REST_PAT => Pat::RestPat(RestPat { syntax }),
SLICE_PAT => Pat::SlicePat(SlicePat { syntax }),
TUPLE_PAT => Pat::TuplePat(TuplePat { syntax }),
TUPLE_STRUCT_PAT => Pat::TupleStructPat(TupleStructPat { syntax }),
WILDCARD_PAT => Pat::WildcardPat(WildcardPat { syntax }),
_ => return None,
};
Some(res)
}
#[inline]
fn syntax(&self) -> &SyntaxNode {
match self {
Pat::BoxPat(it) => &it.syntax,
Pat::ConstBlockPat(it) => &it.syntax,
Pat::IdentPat(it) => &it.syntax,
Pat::LiteralPat(it) => &it.syntax,
Pat::MacroPat(it) => &it.syntax,
Pat::OrPat(it) => &it.syntax,
Pat::ParenPat(it) => &it.syntax,
Pat::PathPat(it) => &it.syntax,
Pat::RangePat(it) => &it.syntax,
Pat::RecordPat(it) => &it.syntax,
Pat::RefPat(it) => &it.syntax,
Pat::RestPat(it) => &it.syntax,
Pat::SlicePat(it) => &it.syntax,
Pat::TuplePat(it) => &it.syntax,
Pat::TupleStructPat(it) => &it.syntax,
Pat::WildcardPat(it) => &it.syntax,
}
}
}
impl From<ExprStmt> for Stmt {
#[inline]
fn from(node: ExprStmt) -> Stmt { Stmt::ExprStmt(node) }
}
impl From<Item> for Stmt {
#[inline]
fn from(node: Item) -> Stmt { Stmt::Item(node) }
}
impl From<LetStmt> for Stmt {
#[inline]
fn from(node: LetStmt) -> Stmt { Stmt::LetStmt(node) }
}
impl From<ArrayType> for Type {
#[inline]
fn from(node: ArrayType) -> Type { Type::ArrayType(node) }
}
impl From<DynTraitType> for Type {
#[inline]
fn from(node: DynTraitType) -> Type { Type::DynTraitType(node) }
}
impl From<FnPtrType> for Type {
#[inline]
fn from(node: FnPtrType) -> Type { Type::FnPtrType(node) }
}
impl From<ForType> for Type {
#[inline]
fn from(node: ForType) -> Type { Type::ForType(node) }
}
impl From<ImplTraitType> for Type {
#[inline]
fn from(node: ImplTraitType) -> Type { Type::ImplTraitType(node) }
}
impl From<InferType> for Type {
#[inline]
fn from(node: InferType) -> Type { Type::InferType(node) }
}
impl From<MacroType> for Type {
#[inline]
fn from(node: MacroType) -> Type { Type::MacroType(node) }
}
impl From<NeverType> for Type {
#[inline]
fn from(node: NeverType) -> Type { Type::NeverType(node) }
}
impl From<ParenType> for Type {
#[inline]
fn from(node: ParenType) -> Type { Type::ParenType(node) }
}
impl From<PathType> for Type {
#[inline]
fn from(node: PathType) -> Type { Type::PathType(node) }
}
impl From<PtrType> for Type {
#[inline]
fn from(node: PtrType) -> Type { Type::PtrType(node) }
}
impl From<RefType> for Type {
#[inline]
fn from(node: RefType) -> Type { Type::RefType(node) }
}
impl From<SliceType> for Type {
#[inline]
fn from(node: SliceType) -> Type { Type::SliceType(node) }
}
impl From<TupleType> for Type {
#[inline]
fn from(node: TupleType) -> Type { Type::TupleType(node) }
}
impl AstNode for Type {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool {
matches!(
kind,
ARRAY_TYPE
| DYN_TRAIT_TYPE
| FN_PTR_TYPE
| FOR_TYPE
| IMPL_TRAIT_TYPE
| INFER_TYPE
| MACRO_TYPE
| NEVER_TYPE
| PAREN_TYPE
| PATH_TYPE
| PTR_TYPE
| REF_TYPE
| SLICE_TYPE
| TUPLE_TYPE
)
}
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
let res = match syntax.kind() {
ARRAY_TYPE => Type::ArrayType(ArrayType { syntax }),
DYN_TRAIT_TYPE => Type::DynTraitType(DynTraitType { syntax }),
FN_PTR_TYPE => Type::FnPtrType(FnPtrType { syntax }),
FOR_TYPE => Type::ForType(ForType { syntax }),
IMPL_TRAIT_TYPE => Type::ImplTraitType(ImplTraitType { syntax }),
INFER_TYPE => Type::InferType(InferType { syntax }),
MACRO_TYPE => Type::MacroType(MacroType { syntax }),
NEVER_TYPE => Type::NeverType(NeverType { syntax }),
PAREN_TYPE => Type::ParenType(ParenType { syntax }),
PATH_TYPE => Type::PathType(PathType { syntax }),
PTR_TYPE => Type::PtrType(PtrType { syntax }),
REF_TYPE => Type::RefType(RefType { syntax }),
SLICE_TYPE => Type::SliceType(SliceType { syntax }),
TUPLE_TYPE => Type::TupleType(TupleType { syntax }),
_ => return None,
};
Some(res)
}
#[inline]
fn syntax(&self) -> &SyntaxNode {
match self {
Type::ArrayType(it) => &it.syntax,
Type::DynTraitType(it) => &it.syntax,
Type::FnPtrType(it) => &it.syntax,
Type::ForType(it) => &it.syntax,
Type::ImplTraitType(it) => &it.syntax,
Type::InferType(it) => &it.syntax,
Type::MacroType(it) => &it.syntax,
Type::NeverType(it) => &it.syntax,
Type::ParenType(it) => &it.syntax,
Type::PathType(it) => &it.syntax,
Type::PtrType(it) => &it.syntax,
Type::RefType(it) => &it.syntax,
Type::SliceType(it) => &it.syntax,
Type::TupleType(it) => &it.syntax,
}
}
}
impl From<Lifetime> for UseBoundGenericArg {
#[inline]
fn from(node: Lifetime) -> UseBoundGenericArg { UseBoundGenericArg::Lifetime(node) }
}
impl From<NameRef> for UseBoundGenericArg {
#[inline]
fn from(node: NameRef) -> UseBoundGenericArg { UseBoundGenericArg::NameRef(node) }
}
impl AstNode for UseBoundGenericArg {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { matches!(kind, LIFETIME | NAME_REF) }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
let res = match syntax.kind() {
LIFETIME => UseBoundGenericArg::Lifetime(Lifetime { syntax }),
NAME_REF => UseBoundGenericArg::NameRef(NameRef { syntax }),
_ => return None,
};
Some(res)
}
#[inline]
fn syntax(&self) -> &SyntaxNode {
match self {
UseBoundGenericArg::Lifetime(it) => &it.syntax,
UseBoundGenericArg::NameRef(it) => &it.syntax,
}
}
}
impl AnyHasArgList {
#[inline]
pub fn new<T: ast::HasArgList>(node: T) -> AnyHasArgList {
AnyHasArgList { syntax: node.syntax().clone() }
}
}
impl AstNode for AnyHasArgList {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { matches!(kind, CALL_EXPR | METHOD_CALL_EXPR) }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
Self::can_cast(syntax.kind()).then_some(AnyHasArgList { syntax })
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl From<CallExpr> for AnyHasArgList {
#[inline]
fn from(node: CallExpr) -> AnyHasArgList { AnyHasArgList { syntax: node.syntax } }
}
impl From<MethodCallExpr> for AnyHasArgList {
#[inline]
fn from(node: MethodCallExpr) -> AnyHasArgList { AnyHasArgList { syntax: node.syntax } }
}
impl AnyHasAttrs {
#[inline]
pub fn new<T: ast::HasAttrs>(node: T) -> AnyHasAttrs {
AnyHasAttrs { syntax: node.syntax().clone() }
}
}
impl AstNode for AnyHasAttrs {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool {
matches!(
kind,
ARRAY_EXPR
| ASM_EXPR
| ASSOC_ITEM_LIST
| AWAIT_EXPR
| BECOME_EXPR
| BIN_EXPR
| BLOCK_EXPR
| BREAK_EXPR
| CALL_EXPR
| CAST_EXPR
| CLOSURE_EXPR
| CONST
| CONST_PARAM
| CONTINUE_EXPR
| ENUM
| EXTERN_BLOCK
| EXTERN_CRATE
| EXTERN_ITEM_LIST
| FIELD_EXPR
| FN
| FOR_EXPR
| FORMAT_ARGS_EXPR
| IDENT_PAT
| IF_EXPR
| IMPL
| INDEX_EXPR
| ITEM_LIST
| LET_EXPR
| LET_STMT
| LIFETIME_PARAM
| LITERAL
| LOOP_EXPR
| MACRO_CALL
| MACRO_DEF
| MACRO_RULES
| MATCH_ARM
| MATCH_ARM_LIST
| MATCH_EXPR
| METHOD_CALL_EXPR
| MODULE
| OFFSET_OF_EXPR
| PARAM
| PAREN_EXPR
| PATH_EXPR
| PREFIX_EXPR
| RANGE_EXPR
| RECORD_EXPR_FIELD
| RECORD_EXPR_FIELD_LIST
| RECORD_FIELD
| RECORD_PAT_FIELD
| REF_EXPR
| REST_PAT
| RETURN_EXPR
| SELF_PARAM
| SOURCE_FILE
| STATIC
| STMT_LIST
| STRUCT
| TRAIT
| TRAIT_ALIAS
| TRY_EXPR
| TUPLE_EXPR
| TUPLE_FIELD
| TYPE_ALIAS
| TYPE_PARAM
| UNDERSCORE_EXPR
| UNION
| USE
| VARIANT
| WHILE_EXPR
| YEET_EXPR
| YIELD_EXPR
)
}
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
Self::can_cast(syntax.kind()).then_some(AnyHasAttrs { syntax })
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl From<ArrayExpr> for AnyHasAttrs {
#[inline]
fn from(node: ArrayExpr) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
}
impl From<AsmExpr> for AnyHasAttrs {
#[inline]
fn from(node: AsmExpr) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
}
impl From<AssocItemList> for AnyHasAttrs {
#[inline]
fn from(node: AssocItemList) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
}
impl From<AwaitExpr> for AnyHasAttrs {
#[inline]
fn from(node: AwaitExpr) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
}
impl From<BecomeExpr> for AnyHasAttrs {
#[inline]
fn from(node: BecomeExpr) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
}
impl From<BinExpr> for AnyHasAttrs {
#[inline]
fn from(node: BinExpr) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
}
impl From<BlockExpr> for AnyHasAttrs {
#[inline]
fn from(node: BlockExpr) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
}
impl From<BreakExpr> for AnyHasAttrs {
#[inline]
fn from(node: BreakExpr) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
}
impl From<CallExpr> for AnyHasAttrs {
#[inline]
fn from(node: CallExpr) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
}
impl From<CastExpr> for AnyHasAttrs {
#[inline]
fn from(node: CastExpr) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
}
impl From<ClosureExpr> for AnyHasAttrs {
#[inline]
fn from(node: ClosureExpr) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
}
impl From<Const> for AnyHasAttrs {
#[inline]
fn from(node: Const) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
}
impl From<ConstParam> for AnyHasAttrs {
#[inline]
fn from(node: ConstParam) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
}
impl From<ContinueExpr> for AnyHasAttrs {
#[inline]
fn from(node: ContinueExpr) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
}
impl From<Enum> for AnyHasAttrs {
#[inline]
fn from(node: Enum) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
}
impl From<ExternBlock> for AnyHasAttrs {
#[inline]
fn from(node: ExternBlock) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
}
impl From<ExternCrate> for AnyHasAttrs {
#[inline]
fn from(node: ExternCrate) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
}
impl From<ExternItemList> for AnyHasAttrs {
#[inline]
fn from(node: ExternItemList) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
}
impl From<FieldExpr> for AnyHasAttrs {
#[inline]
fn from(node: FieldExpr) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
}
impl From<Fn> for AnyHasAttrs {
#[inline]
fn from(node: Fn) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
}
impl From<ForExpr> for AnyHasAttrs {
#[inline]
fn from(node: ForExpr) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
}
impl From<FormatArgsExpr> for AnyHasAttrs {
#[inline]
fn from(node: FormatArgsExpr) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
}
impl From<IdentPat> for AnyHasAttrs {
#[inline]
fn from(node: IdentPat) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
}
impl From<IfExpr> for AnyHasAttrs {
#[inline]
fn from(node: IfExpr) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
}
impl From<Impl> for AnyHasAttrs {
#[inline]
fn from(node: Impl) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
}
impl From<IndexExpr> for AnyHasAttrs {
#[inline]
fn from(node: IndexExpr) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
}
impl From<ItemList> for AnyHasAttrs {
#[inline]
fn from(node: ItemList) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
}
impl From<LetExpr> for AnyHasAttrs {
#[inline]
fn from(node: LetExpr) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
}
impl From<LetStmt> for AnyHasAttrs {
#[inline]
fn from(node: LetStmt) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
}
impl From<LifetimeParam> for AnyHasAttrs {
#[inline]
fn from(node: LifetimeParam) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
}
impl From<Literal> for AnyHasAttrs {
#[inline]
fn from(node: Literal) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
}
impl From<LoopExpr> for AnyHasAttrs {
#[inline]
fn from(node: LoopExpr) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
}
impl From<MacroCall> for AnyHasAttrs {
#[inline]
fn from(node: MacroCall) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
}
impl From<MacroDef> for AnyHasAttrs {
#[inline]
fn from(node: MacroDef) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
}
impl From<MacroRules> for AnyHasAttrs {
#[inline]
fn from(node: MacroRules) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
}
impl From<MatchArm> for AnyHasAttrs {
#[inline]
fn from(node: MatchArm) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
}
impl From<MatchArmList> for AnyHasAttrs {
#[inline]
fn from(node: MatchArmList) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
}
impl From<MatchExpr> for AnyHasAttrs {
#[inline]
fn from(node: MatchExpr) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
}
impl From<MethodCallExpr> for AnyHasAttrs {
#[inline]
fn from(node: MethodCallExpr) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
}
impl From<Module> for AnyHasAttrs {
#[inline]
fn from(node: Module) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
}
impl From<OffsetOfExpr> for AnyHasAttrs {
#[inline]
fn from(node: OffsetOfExpr) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
}
impl From<Param> for AnyHasAttrs {
#[inline]
fn from(node: Param) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
}
impl From<ParenExpr> for AnyHasAttrs {
#[inline]
fn from(node: ParenExpr) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
}
impl From<PathExpr> for AnyHasAttrs {
#[inline]
fn from(node: PathExpr) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
}
impl From<PrefixExpr> for AnyHasAttrs {
#[inline]
fn from(node: PrefixExpr) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
}
impl From<RangeExpr> for AnyHasAttrs {
#[inline]
fn from(node: RangeExpr) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
}
impl From<RecordExprField> for AnyHasAttrs {
#[inline]
fn from(node: RecordExprField) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
}
impl From<RecordExprFieldList> for AnyHasAttrs {
#[inline]
fn from(node: RecordExprFieldList) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
}
impl From<RecordField> for AnyHasAttrs {
#[inline]
fn from(node: RecordField) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
}
impl From<RecordPatField> for AnyHasAttrs {
#[inline]
fn from(node: RecordPatField) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
}
impl From<RefExpr> for AnyHasAttrs {
#[inline]
fn from(node: RefExpr) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
}
impl From<RestPat> for AnyHasAttrs {
#[inline]
fn from(node: RestPat) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
}
impl From<ReturnExpr> for AnyHasAttrs {
#[inline]
fn from(node: ReturnExpr) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
}
impl From<SelfParam> for AnyHasAttrs {
#[inline]
fn from(node: SelfParam) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
}
impl From<SourceFile> for AnyHasAttrs {
#[inline]
fn from(node: SourceFile) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
}
impl From<Static> for AnyHasAttrs {
#[inline]
fn from(node: Static) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
}
impl From<StmtList> for AnyHasAttrs {
#[inline]
fn from(node: StmtList) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
}
impl From<Struct> for AnyHasAttrs {
#[inline]
fn from(node: Struct) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
}
impl From<Trait> for AnyHasAttrs {
#[inline]
fn from(node: Trait) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
}
impl From<TraitAlias> for AnyHasAttrs {
#[inline]
fn from(node: TraitAlias) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
}
impl From<TryExpr> for AnyHasAttrs {
#[inline]
fn from(node: TryExpr) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
}
impl From<TupleExpr> for AnyHasAttrs {
#[inline]
fn from(node: TupleExpr) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
}
impl From<TupleField> for AnyHasAttrs {
#[inline]
fn from(node: TupleField) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
}
impl From<TypeAlias> for AnyHasAttrs {
#[inline]
fn from(node: TypeAlias) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
}
impl From<TypeParam> for AnyHasAttrs {
#[inline]
fn from(node: TypeParam) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
}
impl From<UnderscoreExpr> for AnyHasAttrs {
#[inline]
fn from(node: UnderscoreExpr) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
}
impl From<Union> for AnyHasAttrs {
#[inline]
fn from(node: Union) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
}
impl From<Use> for AnyHasAttrs {
#[inline]
fn from(node: Use) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
}
impl From<Variant> for AnyHasAttrs {
#[inline]
fn from(node: Variant) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
}
impl From<WhileExpr> for AnyHasAttrs {
#[inline]
fn from(node: WhileExpr) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
}
impl From<YeetExpr> for AnyHasAttrs {
#[inline]
fn from(node: YeetExpr) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
}
impl From<YieldExpr> for AnyHasAttrs {
#[inline]
fn from(node: YieldExpr) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
}
impl AnyHasDocComments {
#[inline]
pub fn new<T: ast::HasDocComments>(node: T) -> AnyHasDocComments {
AnyHasDocComments { syntax: node.syntax().clone() }
}
}
impl AstNode for AnyHasDocComments {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool {
matches!(
kind,
CONST
| ENUM
| EXTERN_BLOCK
| EXTERN_CRATE
| FN
| IMPL
| MACRO_CALL
| MACRO_DEF
| MACRO_RULES
| MODULE
| RECORD_FIELD
| SOURCE_FILE
| STATIC
| STRUCT
| TRAIT
| TRAIT_ALIAS
| TUPLE_FIELD
| TYPE_ALIAS
| UNION
| USE
| VARIANT
)
}
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
Self::can_cast(syntax.kind()).then_some(AnyHasDocComments { syntax })
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl From<Const> for AnyHasDocComments {
#[inline]
fn from(node: Const) -> AnyHasDocComments { AnyHasDocComments { syntax: node.syntax } }
}
impl From<Enum> for AnyHasDocComments {
#[inline]
fn from(node: Enum) -> AnyHasDocComments { AnyHasDocComments { syntax: node.syntax } }
}
impl From<ExternBlock> for AnyHasDocComments {
#[inline]
fn from(node: ExternBlock) -> AnyHasDocComments { AnyHasDocComments { syntax: node.syntax } }
}
impl From<ExternCrate> for AnyHasDocComments {
#[inline]
fn from(node: ExternCrate) -> AnyHasDocComments { AnyHasDocComments { syntax: node.syntax } }
}
impl From<Fn> for AnyHasDocComments {
#[inline]
fn from(node: Fn) -> AnyHasDocComments { AnyHasDocComments { syntax: node.syntax } }
}
impl From<Impl> for AnyHasDocComments {
#[inline]
fn from(node: Impl) -> AnyHasDocComments { AnyHasDocComments { syntax: node.syntax } }
}
impl From<MacroCall> for AnyHasDocComments {
#[inline]
fn from(node: MacroCall) -> AnyHasDocComments { AnyHasDocComments { syntax: node.syntax } }
}
impl From<MacroDef> for AnyHasDocComments {
#[inline]
fn from(node: MacroDef) -> AnyHasDocComments { AnyHasDocComments { syntax: node.syntax } }
}
impl From<MacroRules> for AnyHasDocComments {
#[inline]
fn from(node: MacroRules) -> AnyHasDocComments { AnyHasDocComments { syntax: node.syntax } }
}
impl From<Module> for AnyHasDocComments {
#[inline]
fn from(node: Module) -> AnyHasDocComments { AnyHasDocComments { syntax: node.syntax } }
}
impl From<RecordField> for AnyHasDocComments {
#[inline]
fn from(node: RecordField) -> AnyHasDocComments { AnyHasDocComments { syntax: node.syntax } }
}
impl From<SourceFile> for AnyHasDocComments {
#[inline]
fn from(node: SourceFile) -> AnyHasDocComments { AnyHasDocComments { syntax: node.syntax } }
}
impl From<Static> for AnyHasDocComments {
#[inline]
fn from(node: Static) -> AnyHasDocComments { AnyHasDocComments { syntax: node.syntax } }
}
impl From<Struct> for AnyHasDocComments {
#[inline]
fn from(node: Struct) -> AnyHasDocComments { AnyHasDocComments { syntax: node.syntax } }
}
impl From<Trait> for AnyHasDocComments {
#[inline]
fn from(node: Trait) -> AnyHasDocComments { AnyHasDocComments { syntax: node.syntax } }
}
impl From<TraitAlias> for AnyHasDocComments {
#[inline]
fn from(node: TraitAlias) -> AnyHasDocComments { AnyHasDocComments { syntax: node.syntax } }
}
impl From<TupleField> for AnyHasDocComments {
#[inline]
fn from(node: TupleField) -> AnyHasDocComments { AnyHasDocComments { syntax: node.syntax } }
}
impl From<TypeAlias> for AnyHasDocComments {
#[inline]
fn from(node: TypeAlias) -> AnyHasDocComments { AnyHasDocComments { syntax: node.syntax } }
}
impl From<Union> for AnyHasDocComments {
#[inline]
fn from(node: Union) -> AnyHasDocComments { AnyHasDocComments { syntax: node.syntax } }
}
impl From<Use> for AnyHasDocComments {
#[inline]
fn from(node: Use) -> AnyHasDocComments { AnyHasDocComments { syntax: node.syntax } }
}
impl From<Variant> for AnyHasDocComments {
#[inline]
fn from(node: Variant) -> AnyHasDocComments { AnyHasDocComments { syntax: node.syntax } }
}
impl AnyHasGenericArgs {
#[inline]
pub fn new<T: ast::HasGenericArgs>(node: T) -> AnyHasGenericArgs {
AnyHasGenericArgs { syntax: node.syntax().clone() }
}
}
impl AstNode for AnyHasGenericArgs {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool {
matches!(kind, ASSOC_TYPE_ARG | METHOD_CALL_EXPR | PATH_SEGMENT)
}
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
Self::can_cast(syntax.kind()).then_some(AnyHasGenericArgs { syntax })
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl From<AssocTypeArg> for AnyHasGenericArgs {
#[inline]
fn from(node: AssocTypeArg) -> AnyHasGenericArgs { AnyHasGenericArgs { syntax: node.syntax } }
}
impl From<MethodCallExpr> for AnyHasGenericArgs {
#[inline]
fn from(node: MethodCallExpr) -> AnyHasGenericArgs { AnyHasGenericArgs { syntax: node.syntax } }
}
impl From<PathSegment> for AnyHasGenericArgs {
#[inline]
fn from(node: PathSegment) -> AnyHasGenericArgs { AnyHasGenericArgs { syntax: node.syntax } }
}
impl AnyHasGenericParams {
#[inline]
pub fn new<T: ast::HasGenericParams>(node: T) -> AnyHasGenericParams {
AnyHasGenericParams { syntax: node.syntax().clone() }
}
}
impl AstNode for AnyHasGenericParams {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool {
matches!(kind, ENUM | FN | IMPL | STRUCT | TRAIT | TRAIT_ALIAS | TYPE_ALIAS | UNION)
}
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
Self::can_cast(syntax.kind()).then_some(AnyHasGenericParams { syntax })
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl From<Enum> for AnyHasGenericParams {
#[inline]
fn from(node: Enum) -> AnyHasGenericParams { AnyHasGenericParams { syntax: node.syntax } }
}
impl From<Fn> for AnyHasGenericParams {
#[inline]
fn from(node: Fn) -> AnyHasGenericParams { AnyHasGenericParams { syntax: node.syntax } }
}
impl From<Impl> for AnyHasGenericParams {
#[inline]
fn from(node: Impl) -> AnyHasGenericParams { AnyHasGenericParams { syntax: node.syntax } }
}
impl From<Struct> for AnyHasGenericParams {
#[inline]
fn from(node: Struct) -> AnyHasGenericParams { AnyHasGenericParams { syntax: node.syntax } }
}
impl From<Trait> for AnyHasGenericParams {
#[inline]
fn from(node: Trait) -> AnyHasGenericParams { AnyHasGenericParams { syntax: node.syntax } }
}
impl From<TraitAlias> for AnyHasGenericParams {
#[inline]
fn from(node: TraitAlias) -> AnyHasGenericParams { AnyHasGenericParams { syntax: node.syntax } }
}
impl From<TypeAlias> for AnyHasGenericParams {
#[inline]
fn from(node: TypeAlias) -> AnyHasGenericParams { AnyHasGenericParams { syntax: node.syntax } }
}
impl From<Union> for AnyHasGenericParams {
#[inline]
fn from(node: Union) -> AnyHasGenericParams { AnyHasGenericParams { syntax: node.syntax } }
}
impl AnyHasLoopBody {
#[inline]
pub fn new<T: ast::HasLoopBody>(node: T) -> AnyHasLoopBody {
AnyHasLoopBody { syntax: node.syntax().clone() }
}
}
impl AstNode for AnyHasLoopBody {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { matches!(kind, FOR_EXPR | LOOP_EXPR | WHILE_EXPR) }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
Self::can_cast(syntax.kind()).then_some(AnyHasLoopBody { syntax })
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl From<ForExpr> for AnyHasLoopBody {
#[inline]
fn from(node: ForExpr) -> AnyHasLoopBody { AnyHasLoopBody { syntax: node.syntax } }
}
impl From<LoopExpr> for AnyHasLoopBody {
#[inline]
fn from(node: LoopExpr) -> AnyHasLoopBody { AnyHasLoopBody { syntax: node.syntax } }
}
impl From<WhileExpr> for AnyHasLoopBody {
#[inline]
fn from(node: WhileExpr) -> AnyHasLoopBody { AnyHasLoopBody { syntax: node.syntax } }
}
impl AnyHasModuleItem {
#[inline]
pub fn new<T: ast::HasModuleItem>(node: T) -> AnyHasModuleItem {
AnyHasModuleItem { syntax: node.syntax().clone() }
}
}
impl AstNode for AnyHasModuleItem {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool { matches!(kind, ITEM_LIST | MACRO_ITEMS | SOURCE_FILE) }
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
Self::can_cast(syntax.kind()).then_some(AnyHasModuleItem { syntax })
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl From<ItemList> for AnyHasModuleItem {
#[inline]
fn from(node: ItemList) -> AnyHasModuleItem { AnyHasModuleItem { syntax: node.syntax } }
}
impl From<MacroItems> for AnyHasModuleItem {
#[inline]
fn from(node: MacroItems) -> AnyHasModuleItem { AnyHasModuleItem { syntax: node.syntax } }
}
impl From<SourceFile> for AnyHasModuleItem {
#[inline]
fn from(node: SourceFile) -> AnyHasModuleItem { AnyHasModuleItem { syntax: node.syntax } }
}
impl AnyHasName {
#[inline]
pub fn new<T: ast::HasName>(node: T) -> AnyHasName {
AnyHasName { syntax: node.syntax().clone() }
}
}
impl AstNode for AnyHasName {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool {
matches!(
kind,
ASM_OPERAND_NAMED
| CONST
| CONST_PARAM
| ENUM
| FN
| FORMAT_ARGS_ARG
| IDENT_PAT
| MACRO_DEF
| MACRO_RULES
| MODULE
| RECORD_FIELD
| RENAME
| SELF_PARAM
| STATIC
| STRUCT
| TRAIT
| TRAIT_ALIAS
| TYPE_ALIAS
| TYPE_PARAM
| UNION
| VARIANT
)
}
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
Self::can_cast(syntax.kind()).then_some(AnyHasName { syntax })
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl From<AsmOperandNamed> for AnyHasName {
#[inline]
fn from(node: AsmOperandNamed) -> AnyHasName { AnyHasName { syntax: node.syntax } }
}
impl From<Const> for AnyHasName {
#[inline]
fn from(node: Const) -> AnyHasName { AnyHasName { syntax: node.syntax } }
}
impl From<ConstParam> for AnyHasName {
#[inline]
fn from(node: ConstParam) -> AnyHasName { AnyHasName { syntax: node.syntax } }
}
impl From<Enum> for AnyHasName {
#[inline]
fn from(node: Enum) -> AnyHasName { AnyHasName { syntax: node.syntax } }
}
impl From<Fn> for AnyHasName {
#[inline]
fn from(node: Fn) -> AnyHasName { AnyHasName { syntax: node.syntax } }
}
impl From<FormatArgsArg> for AnyHasName {
#[inline]
fn from(node: FormatArgsArg) -> AnyHasName { AnyHasName { syntax: node.syntax } }
}
impl From<IdentPat> for AnyHasName {
#[inline]
fn from(node: IdentPat) -> AnyHasName { AnyHasName { syntax: node.syntax } }
}
impl From<MacroDef> for AnyHasName {
#[inline]
fn from(node: MacroDef) -> AnyHasName { AnyHasName { syntax: node.syntax } }
}
impl From<MacroRules> for AnyHasName {
#[inline]
fn from(node: MacroRules) -> AnyHasName { AnyHasName { syntax: node.syntax } }
}
impl From<Module> for AnyHasName {
#[inline]
fn from(node: Module) -> AnyHasName { AnyHasName { syntax: node.syntax } }
}
impl From<RecordField> for AnyHasName {
#[inline]
fn from(node: RecordField) -> AnyHasName { AnyHasName { syntax: node.syntax } }
}
impl From<Rename> for AnyHasName {
#[inline]
fn from(node: Rename) -> AnyHasName { AnyHasName { syntax: node.syntax } }
}
impl From<SelfParam> for AnyHasName {
#[inline]
fn from(node: SelfParam) -> AnyHasName { AnyHasName { syntax: node.syntax } }
}
impl From<Static> for AnyHasName {
#[inline]
fn from(node: Static) -> AnyHasName { AnyHasName { syntax: node.syntax } }
}
impl From<Struct> for AnyHasName {
#[inline]
fn from(node: Struct) -> AnyHasName { AnyHasName { syntax: node.syntax } }
}
impl From<Trait> for AnyHasName {
#[inline]
fn from(node: Trait) -> AnyHasName { AnyHasName { syntax: node.syntax } }
}
impl From<TraitAlias> for AnyHasName {
#[inline]
fn from(node: TraitAlias) -> AnyHasName { AnyHasName { syntax: node.syntax } }
}
impl From<TypeAlias> for AnyHasName {
#[inline]
fn from(node: TypeAlias) -> AnyHasName { AnyHasName { syntax: node.syntax } }
}
impl From<TypeParam> for AnyHasName {
#[inline]
fn from(node: TypeParam) -> AnyHasName { AnyHasName { syntax: node.syntax } }
}
impl From<Union> for AnyHasName {
#[inline]
fn from(node: Union) -> AnyHasName { AnyHasName { syntax: node.syntax } }
}
impl From<Variant> for AnyHasName {
#[inline]
fn from(node: Variant) -> AnyHasName { AnyHasName { syntax: node.syntax } }
}
impl AnyHasTypeBounds {
#[inline]
pub fn new<T: ast::HasTypeBounds>(node: T) -> AnyHasTypeBounds {
AnyHasTypeBounds { syntax: node.syntax().clone() }
}
}
impl AstNode for AnyHasTypeBounds {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool {
matches!(
kind,
ASSOC_TYPE_ARG | LIFETIME_PARAM | TRAIT | TYPE_ALIAS | TYPE_PARAM | WHERE_PRED
)
}
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
Self::can_cast(syntax.kind()).then_some(AnyHasTypeBounds { syntax })
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl From<AssocTypeArg> for AnyHasTypeBounds {
#[inline]
fn from(node: AssocTypeArg) -> AnyHasTypeBounds { AnyHasTypeBounds { syntax: node.syntax } }
}
impl From<LifetimeParam> for AnyHasTypeBounds {
#[inline]
fn from(node: LifetimeParam) -> AnyHasTypeBounds { AnyHasTypeBounds { syntax: node.syntax } }
}
impl From<Trait> for AnyHasTypeBounds {
#[inline]
fn from(node: Trait) -> AnyHasTypeBounds { AnyHasTypeBounds { syntax: node.syntax } }
}
impl From<TypeAlias> for AnyHasTypeBounds {
#[inline]
fn from(node: TypeAlias) -> AnyHasTypeBounds { AnyHasTypeBounds { syntax: node.syntax } }
}
impl From<TypeParam> for AnyHasTypeBounds {
#[inline]
fn from(node: TypeParam) -> AnyHasTypeBounds { AnyHasTypeBounds { syntax: node.syntax } }
}
impl From<WherePred> for AnyHasTypeBounds {
#[inline]
fn from(node: WherePred) -> AnyHasTypeBounds { AnyHasTypeBounds { syntax: node.syntax } }
}
impl AnyHasVisibility {
#[inline]
pub fn new<T: ast::HasVisibility>(node: T) -> AnyHasVisibility {
AnyHasVisibility { syntax: node.syntax().clone() }
}
}
impl AstNode for AnyHasVisibility {
#[inline]
fn can_cast(kind: SyntaxKind) -> bool {
matches!(
kind,
CONST
| ENUM
| EXTERN_CRATE
| FN
| IMPL
| MACRO_DEF
| MACRO_RULES
| MODULE
| RECORD_FIELD
| STATIC
| STRUCT
| TRAIT
| TRAIT_ALIAS
| TUPLE_FIELD
| TYPE_ALIAS
| UNION
| USE
| VARIANT
)
}
#[inline]
fn cast(syntax: SyntaxNode) -> Option<Self> {
Self::can_cast(syntax.kind()).then_some(AnyHasVisibility { syntax })
}
#[inline]
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl From<Const> for AnyHasVisibility {
#[inline]
fn from(node: Const) -> AnyHasVisibility { AnyHasVisibility { syntax: node.syntax } }
}
impl From<Enum> for AnyHasVisibility {
#[inline]
fn from(node: Enum) -> AnyHasVisibility { AnyHasVisibility { syntax: node.syntax } }
}
impl From<ExternCrate> for AnyHasVisibility {
#[inline]
fn from(node: ExternCrate) -> AnyHasVisibility { AnyHasVisibility { syntax: node.syntax } }
}
impl From<Fn> for AnyHasVisibility {
#[inline]
fn from(node: Fn) -> AnyHasVisibility { AnyHasVisibility { syntax: node.syntax } }
}
impl From<Impl> for AnyHasVisibility {
#[inline]
fn from(node: Impl) -> AnyHasVisibility { AnyHasVisibility { syntax: node.syntax } }
}
impl From<MacroDef> for AnyHasVisibility {
#[inline]
fn from(node: MacroDef) -> AnyHasVisibility { AnyHasVisibility { syntax: node.syntax } }
}
impl From<MacroRules> for AnyHasVisibility {
#[inline]
fn from(node: MacroRules) -> AnyHasVisibility { AnyHasVisibility { syntax: node.syntax } }
}
impl From<Module> for AnyHasVisibility {
#[inline]
fn from(node: Module) -> AnyHasVisibility { AnyHasVisibility { syntax: node.syntax } }
}
impl From<RecordField> for AnyHasVisibility {
#[inline]
fn from(node: RecordField) -> AnyHasVisibility { AnyHasVisibility { syntax: node.syntax } }
}
impl From<Static> for AnyHasVisibility {
#[inline]
fn from(node: Static) -> AnyHasVisibility { AnyHasVisibility { syntax: node.syntax } }
}
impl From<Struct> for AnyHasVisibility {
#[inline]
fn from(node: Struct) -> AnyHasVisibility { AnyHasVisibility { syntax: node.syntax } }
}
impl From<Trait> for AnyHasVisibility {
#[inline]
fn from(node: Trait) -> AnyHasVisibility { AnyHasVisibility { syntax: node.syntax } }
}
impl From<TraitAlias> for AnyHasVisibility {
#[inline]
fn from(node: TraitAlias) -> AnyHasVisibility { AnyHasVisibility { syntax: node.syntax } }
}
impl From<TupleField> for AnyHasVisibility {
#[inline]
fn from(node: TupleField) -> AnyHasVisibility { AnyHasVisibility { syntax: node.syntax } }
}
impl From<TypeAlias> for AnyHasVisibility {
#[inline]
fn from(node: TypeAlias) -> AnyHasVisibility { AnyHasVisibility { syntax: node.syntax } }
}
impl From<Union> for AnyHasVisibility {
#[inline]
fn from(node: Union) -> AnyHasVisibility { AnyHasVisibility { syntax: node.syntax } }
}
impl From<Use> for AnyHasVisibility {
#[inline]
fn from(node: Use) -> AnyHasVisibility { AnyHasVisibility { syntax: node.syntax } }
}
impl From<Variant> for AnyHasVisibility {
#[inline]
fn from(node: Variant) -> AnyHasVisibility { AnyHasVisibility { syntax: node.syntax } }
}
impl std::fmt::Display for Adt {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for AsmOperand {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for AsmPiece {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for AssocItem {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for Expr {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for ExternItem {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for FieldList {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for GenericArg {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for GenericParam {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for Item {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for Pat {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for Stmt {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for Type {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for UseBoundGenericArg {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for Abi {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for ArgList {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for ArrayExpr {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for ArrayType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for AsmClobberAbi {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for AsmConst {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for AsmDirSpec {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for AsmExpr {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for AsmLabel {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for AsmOperandExpr {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for AsmOperandNamed {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for AsmOption {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for AsmOptions {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for AsmRegOperand {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for AsmRegSpec {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for AsmSym {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for AssocItemList {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for AssocTypeArg {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for Attr {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for AwaitExpr {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for BecomeExpr {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for BinExpr {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for BlockExpr {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for BoxPat {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for BreakExpr {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for CallExpr {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for CastExpr {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for ClosureBinder {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for ClosureExpr {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for Const {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for ConstArg {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for ConstBlockPat {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for ConstParam {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for ContinueExpr {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for DynTraitType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for Enum {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for ExprStmt {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for ExternBlock {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for ExternCrate {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for ExternItemList {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for FieldExpr {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for Fn {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for FnPtrType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for ForExpr {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for ForType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for FormatArgsArg {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for FormatArgsExpr {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for GenericArgList {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for GenericParamList {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for IdentPat {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for IfExpr {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for Impl {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for ImplTraitType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for IndexExpr {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for InferType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for ItemList {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for Label {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for LetElse {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for LetExpr {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for LetStmt {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for Lifetime {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for LifetimeArg {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for LifetimeParam {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for Literal {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for LiteralPat {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for LoopExpr {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for MacroCall {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for MacroDef {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for MacroExpr {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for MacroItems {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for MacroPat {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for MacroRules {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for MacroStmts {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for MacroType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for MatchArm {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for MatchArmList {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for MatchExpr {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for MatchGuard {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for Meta {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for MethodCallExpr {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for Module {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for Name {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for NameRef {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for NeverType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for OffsetOfExpr {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for OrPat {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for Param {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for ParamList {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for ParenExpr {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for ParenPat {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for ParenType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for ParenthesizedArgList {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for Path {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for PathExpr {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for PathPat {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for PathSegment {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for PathType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for PrefixExpr {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for PtrType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for RangeExpr {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for RangePat {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for RecordExpr {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for RecordExprField {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for RecordExprFieldList {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for RecordField {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for RecordFieldList {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for RecordPat {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for RecordPatField {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for RecordPatFieldList {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for RefExpr {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for RefPat {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for RefType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for Rename {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for RestPat {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for RetType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for ReturnExpr {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for ReturnTypeSyntax {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for SelfParam {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for SlicePat {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for SliceType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for SourceFile {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for Static {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for StmtList {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for Struct {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for TokenTree {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for Trait {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for TraitAlias {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for TryExpr {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for TupleExpr {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for TupleField {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for TupleFieldList {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for TuplePat {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for TupleStructPat {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for TupleType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for TypeAlias {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for TypeArg {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for TypeBound {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for TypeBoundList {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for TypeParam {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for UnderscoreExpr {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for Union {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for Use {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for UseBoundGenericArgs {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for UseTree {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for UseTreeList {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for Variant {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for VariantList {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for Visibility {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for WhereClause {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for WherePred {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for WhileExpr {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for WildcardPat {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for YeetExpr {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for YieldExpr {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}