1#![allow(non_snake_case)]
4use crate::{
5 SyntaxKind::{self, *},
6 SyntaxNode, SyntaxToken, T,
7 ast::{self, AstChildren, AstNode, support},
8};
9use std::{fmt, hash};
10pub struct Abi {
11 pub(crate) syntax: SyntaxNode,
12}
13impl Abi {
14 #[inline]
15 pub fn extern_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![extern]) }
16 #[inline]
17 pub fn string_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![string]) }
18}
19pub struct ArgList {
20 pub(crate) syntax: SyntaxNode,
21}
22impl ArgList {
23 #[inline]
24 pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['(']) }
25 #[inline]
26 pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) }
27}
28pub struct ArrayExpr {
29 pub(crate) syntax: SyntaxNode,
30}
31impl ast::HasAttrs for ArrayExpr {}
32impl ArrayExpr {
33 #[inline]
34 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
35 #[inline]
36 pub fn exprs(&self) -> AstChildren<Expr> { support::children(&self.syntax) }
37 #[inline]
38 pub fn l_brack_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['[']) }
39 #[inline]
40 pub fn r_brack_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![']']) }
41 #[inline]
42 pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) }
43}
44pub struct ArrayType {
45 pub(crate) syntax: SyntaxNode,
46}
47impl ArrayType {
48 #[inline]
49 pub fn const_arg(&self) -> Option<ConstArg> { support::child(&self.syntax) }
50 #[inline]
51 pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) }
52 #[inline]
53 pub fn l_brack_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['[']) }
54 #[inline]
55 pub fn r_brack_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![']']) }
56 #[inline]
57 pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) }
58}
59pub struct AsmClobberAbi {
60 pub(crate) syntax: SyntaxNode,
61}
62impl AsmClobberAbi {
63 #[inline]
64 pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['(']) }
65 #[inline]
66 pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) }
67 #[inline]
68 pub fn clobber_abi_token(&self) -> Option<SyntaxToken> {
69 support::token(&self.syntax, T![clobber_abi])
70 }
71 #[inline]
72 pub fn string_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![string]) }
73}
74pub struct AsmConst {
75 pub(crate) syntax: SyntaxNode,
76}
77impl AsmConst {
78 #[inline]
79 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
80 #[inline]
81 pub fn const_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![const]) }
82}
83pub struct AsmDirSpec {
84 pub(crate) syntax: SyntaxNode,
85}
86impl AsmDirSpec {
87 #[inline]
88 pub fn in_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![in]) }
89 #[inline]
90 pub fn inlateout_token(&self) -> Option<SyntaxToken> {
91 support::token(&self.syntax, T![inlateout])
92 }
93 #[inline]
94 pub fn inout_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![inout]) }
95 #[inline]
96 pub fn lateout_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![lateout]) }
97 #[inline]
98 pub fn out_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![out]) }
99}
100pub struct AsmExpr {
101 pub(crate) syntax: SyntaxNode,
102}
103impl ast::HasAttrs for AsmExpr {}
104impl AsmExpr {
105 #[inline]
106 pub fn asm_pieces(&self) -> AstChildren<AsmPiece> { support::children(&self.syntax) }
107 #[inline]
108 pub fn template(&self) -> AstChildren<Expr> { support::children(&self.syntax) }
109 #[inline]
110 pub fn pound_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![#]) }
111 #[inline]
112 pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['(']) }
113 #[inline]
114 pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) }
115 #[inline]
116 pub fn comma_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![,]) }
117 #[inline]
118 pub fn asm_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![asm]) }
119 #[inline]
120 pub fn builtin_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![builtin]) }
121 #[inline]
122 pub fn global_asm_token(&self) -> Option<SyntaxToken> {
123 support::token(&self.syntax, T![global_asm])
124 }
125 #[inline]
126 pub fn naked_asm_token(&self) -> Option<SyntaxToken> {
127 support::token(&self.syntax, T![naked_asm])
128 }
129}
130pub struct AsmLabel {
131 pub(crate) syntax: SyntaxNode,
132}
133impl AsmLabel {
134 #[inline]
135 pub fn block_expr(&self) -> Option<BlockExpr> { support::child(&self.syntax) }
136 #[inline]
137 pub fn label_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![label]) }
138}
139pub struct AsmOperandExpr {
140 pub(crate) syntax: SyntaxNode,
141}
142impl AsmOperandExpr {
143 #[inline]
144 pub fn in_expr(&self) -> Option<Expr> { support::child(&self.syntax) }
145 #[inline]
146 pub fn out_expr(&self) -> Option<Expr> { support::child(&self.syntax) }
147 #[inline]
148 pub fn fat_arrow_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=>]) }
149}
150pub struct AsmOperandNamed {
151 pub(crate) syntax: SyntaxNode,
152}
153impl ast::HasName for AsmOperandNamed {}
154impl AsmOperandNamed {
155 #[inline]
156 pub fn asm_operand(&self) -> Option<AsmOperand> { support::child(&self.syntax) }
157 #[inline]
158 pub fn eq_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=]) }
159}
160pub struct AsmOption {
161 pub(crate) syntax: SyntaxNode,
162}
163impl AsmOption {
164 #[inline]
165 pub fn att_syntax_token(&self) -> Option<SyntaxToken> {
166 support::token(&self.syntax, T![att_syntax])
167 }
168 #[inline]
169 pub fn may_unwind_token(&self) -> Option<SyntaxToken> {
170 support::token(&self.syntax, T![may_unwind])
171 }
172 #[inline]
173 pub fn nomem_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![nomem]) }
174 #[inline]
175 pub fn noreturn_token(&self) -> Option<SyntaxToken> {
176 support::token(&self.syntax, T![noreturn])
177 }
178 #[inline]
179 pub fn nostack_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![nostack]) }
180 #[inline]
181 pub fn preserves_flags_token(&self) -> Option<SyntaxToken> {
182 support::token(&self.syntax, T![preserves_flags])
183 }
184 #[inline]
185 pub fn pure_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![pure]) }
186 #[inline]
187 pub fn raw_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![raw]) }
188 #[inline]
189 pub fn readonly_token(&self) -> Option<SyntaxToken> {
190 support::token(&self.syntax, T![readonly])
191 }
192}
193pub struct AsmOptions {
194 pub(crate) syntax: SyntaxNode,
195}
196impl AsmOptions {
197 #[inline]
198 pub fn asm_options(&self) -> AstChildren<AsmOption> { support::children(&self.syntax) }
199 #[inline]
200 pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['(']) }
201 #[inline]
202 pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) }
203 #[inline]
204 pub fn comma_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![,]) }
205 #[inline]
206 pub fn options_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![options]) }
207}
208pub struct AsmRegOperand {
209 pub(crate) syntax: SyntaxNode,
210}
211impl AsmRegOperand {
212 #[inline]
213 pub fn asm_dir_spec(&self) -> Option<AsmDirSpec> { support::child(&self.syntax) }
214 #[inline]
215 pub fn asm_operand_expr(&self) -> Option<AsmOperandExpr> { support::child(&self.syntax) }
216 #[inline]
217 pub fn asm_reg_spec(&self) -> Option<AsmRegSpec> { support::child(&self.syntax) }
218 #[inline]
219 pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['(']) }
220 #[inline]
221 pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) }
222}
223pub struct AsmRegSpec {
224 pub(crate) syntax: SyntaxNode,
225}
226impl AsmRegSpec {
227 #[inline]
228 pub fn name_ref(&self) -> Option<NameRef> { support::child(&self.syntax) }
229 #[inline]
230 pub fn string_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![string]) }
231}
232pub struct AsmSym {
233 pub(crate) syntax: SyntaxNode,
234}
235impl AsmSym {
236 #[inline]
237 pub fn path(&self) -> Option<Path> { support::child(&self.syntax) }
238 #[inline]
239 pub fn sym_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![sym]) }
240}
241pub struct AssocItemList {
242 pub(crate) syntax: SyntaxNode,
243}
244impl ast::HasAttrs for AssocItemList {}
245impl AssocItemList {
246 #[inline]
247 pub fn assoc_items(&self) -> AstChildren<AssocItem> { support::children(&self.syntax) }
248 #[inline]
249 pub fn l_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['{']) }
250 #[inline]
251 pub fn r_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['}']) }
252}
253pub struct AssocTypeArg {
254 pub(crate) syntax: SyntaxNode,
255}
256impl ast::HasGenericArgs for AssocTypeArg {}
257impl ast::HasTypeBounds for AssocTypeArg {}
258impl AssocTypeArg {
259 #[inline]
260 pub fn const_arg(&self) -> Option<ConstArg> { support::child(&self.syntax) }
261 #[inline]
262 pub fn name_ref(&self) -> Option<NameRef> { support::child(&self.syntax) }
263 #[inline]
264 pub fn param_list(&self) -> Option<ParamList> { support::child(&self.syntax) }
265 #[inline]
266 pub fn ret_type(&self) -> Option<RetType> { support::child(&self.syntax) }
267 #[inline]
268 pub fn return_type_syntax(&self) -> Option<ReturnTypeSyntax> { support::child(&self.syntax) }
269 #[inline]
270 pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) }
271 #[inline]
272 pub fn eq_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=]) }
273}
274pub struct Attr {
275 pub(crate) syntax: SyntaxNode,
276}
277impl Attr {
278 #[inline]
279 pub fn meta(&self) -> Option<Meta> { support::child(&self.syntax) }
280 #[inline]
281 pub fn excl_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![!]) }
282 #[inline]
283 pub fn pound_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![#]) }
284 #[inline]
285 pub fn l_brack_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['[']) }
286 #[inline]
287 pub fn r_brack_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![']']) }
288}
289pub struct AwaitExpr {
290 pub(crate) syntax: SyntaxNode,
291}
292impl ast::HasAttrs for AwaitExpr {}
293impl AwaitExpr {
294 #[inline]
295 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
296 #[inline]
297 pub fn dot_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![.]) }
298 #[inline]
299 pub fn await_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![await]) }
300}
301pub struct BecomeExpr {
302 pub(crate) syntax: SyntaxNode,
303}
304impl ast::HasAttrs for BecomeExpr {}
305impl BecomeExpr {
306 #[inline]
307 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
308 #[inline]
309 pub fn become_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![become]) }
310}
311pub struct BinExpr {
312 pub(crate) syntax: SyntaxNode,
313}
314impl ast::HasAttrs for BinExpr {}
315impl BinExpr {}
316pub struct BlockExpr {
317 pub(crate) syntax: SyntaxNode,
318}
319impl ast::HasAttrs for BlockExpr {}
320impl BlockExpr {
321 #[inline]
322 pub fn label(&self) -> Option<Label> { support::child(&self.syntax) }
323 #[inline]
324 pub fn stmt_list(&self) -> Option<StmtList> { support::child(&self.syntax) }
325 #[inline]
326 pub fn async_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![async]) }
327 #[inline]
328 pub fn const_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![const]) }
329 #[inline]
330 pub fn gen_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![gen]) }
331 #[inline]
332 pub fn move_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![move]) }
333 #[inline]
334 pub fn try_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![try]) }
335 #[inline]
336 pub fn unsafe_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![unsafe]) }
337}
338pub struct BoxPat {
339 pub(crate) syntax: SyntaxNode,
340}
341impl BoxPat {
342 #[inline]
343 pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) }
344 #[inline]
345 pub fn box_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![box]) }
346}
347pub struct BreakExpr {
348 pub(crate) syntax: SyntaxNode,
349}
350impl ast::HasAttrs for BreakExpr {}
351impl BreakExpr {
352 #[inline]
353 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
354 #[inline]
355 pub fn lifetime(&self) -> Option<Lifetime> { support::child(&self.syntax) }
356 #[inline]
357 pub fn break_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![break]) }
358}
359pub struct CallExpr {
360 pub(crate) syntax: SyntaxNode,
361}
362impl ast::HasArgList for CallExpr {}
363impl ast::HasAttrs for CallExpr {}
364impl CallExpr {
365 #[inline]
366 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
367}
368pub struct CastExpr {
369 pub(crate) syntax: SyntaxNode,
370}
371impl ast::HasAttrs for CastExpr {}
372impl CastExpr {
373 #[inline]
374 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
375 #[inline]
376 pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) }
377 #[inline]
378 pub fn as_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![as]) }
379}
380pub struct ClosureExpr {
381 pub(crate) syntax: SyntaxNode,
382}
383impl ast::HasAttrs for ClosureExpr {}
384impl ClosureExpr {
385 #[inline]
386 pub fn for_binder(&self) -> Option<ForBinder> { support::child(&self.syntax) }
387 #[inline]
388 pub fn param_list(&self) -> Option<ParamList> { support::child(&self.syntax) }
389 #[inline]
390 pub fn ret_type(&self) -> Option<RetType> { support::child(&self.syntax) }
391 #[inline]
392 pub fn async_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![async]) }
393 #[inline]
394 pub fn const_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![const]) }
395 #[inline]
396 pub fn gen_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![gen]) }
397 #[inline]
398 pub fn move_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![move]) }
399 #[inline]
400 pub fn static_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![static]) }
401}
402pub struct Const {
403 pub(crate) syntax: SyntaxNode,
404}
405impl ast::HasAttrs for Const {}
406impl ast::HasDocComments for Const {}
407impl ast::HasGenericParams for Const {}
408impl ast::HasName for Const {}
409impl ast::HasVisibility for Const {}
410impl Const {
411 #[inline]
412 pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) }
413 #[inline]
414 pub fn colon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![:]) }
415 #[inline]
416 pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) }
417 #[inline]
418 pub fn eq_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=]) }
419 #[inline]
420 pub fn underscore_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![_]) }
421 #[inline]
422 pub fn const_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![const]) }
423 #[inline]
424 pub fn default_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![default]) }
425}
426pub struct ConstArg {
427 pub(crate) syntax: SyntaxNode,
428}
429impl ConstArg {
430 #[inline]
431 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
432}
433pub struct ConstBlockPat {
434 pub(crate) syntax: SyntaxNode,
435}
436impl ConstBlockPat {
437 #[inline]
438 pub fn block_expr(&self) -> Option<BlockExpr> { support::child(&self.syntax) }
439 #[inline]
440 pub fn const_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![const]) }
441}
442pub struct ConstParam {
443 pub(crate) syntax: SyntaxNode,
444}
445impl ast::HasAttrs for ConstParam {}
446impl ast::HasName for ConstParam {}
447impl ConstParam {
448 #[inline]
449 pub fn default_val(&self) -> Option<ConstArg> { support::child(&self.syntax) }
450 #[inline]
451 pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) }
452 #[inline]
453 pub fn colon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![:]) }
454 #[inline]
455 pub fn eq_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=]) }
456 #[inline]
457 pub fn const_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![const]) }
458}
459pub struct ContinueExpr {
460 pub(crate) syntax: SyntaxNode,
461}
462impl ast::HasAttrs for ContinueExpr {}
463impl ContinueExpr {
464 #[inline]
465 pub fn lifetime(&self) -> Option<Lifetime> { support::child(&self.syntax) }
466 #[inline]
467 pub fn continue_token(&self) -> Option<SyntaxToken> {
468 support::token(&self.syntax, T![continue])
469 }
470}
471pub struct DynTraitType {
472 pub(crate) syntax: SyntaxNode,
473}
474impl DynTraitType {
475 #[inline]
476 pub fn type_bound_list(&self) -> Option<TypeBoundList> { support::child(&self.syntax) }
477 #[inline]
478 pub fn dyn_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![dyn]) }
479}
480pub struct Enum {
481 pub(crate) syntax: SyntaxNode,
482}
483impl ast::HasAttrs for Enum {}
484impl ast::HasDocComments for Enum {}
485impl ast::HasGenericParams for Enum {}
486impl ast::HasName for Enum {}
487impl ast::HasVisibility for Enum {}
488impl Enum {
489 #[inline]
490 pub fn variant_list(&self) -> Option<VariantList> { support::child(&self.syntax) }
491 #[inline]
492 pub fn enum_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![enum]) }
493}
494pub struct ExprStmt {
495 pub(crate) syntax: SyntaxNode,
496}
497impl ExprStmt {
498 #[inline]
499 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
500 #[inline]
501 pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) }
502}
503pub struct ExternBlock {
504 pub(crate) syntax: SyntaxNode,
505}
506impl ast::HasAttrs for ExternBlock {}
507impl ast::HasDocComments for ExternBlock {}
508impl ExternBlock {
509 #[inline]
510 pub fn abi(&self) -> Option<Abi> { support::child(&self.syntax) }
511 #[inline]
512 pub fn extern_item_list(&self) -> Option<ExternItemList> { support::child(&self.syntax) }
513 #[inline]
514 pub fn unsafe_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![unsafe]) }
515}
516pub struct ExternCrate {
517 pub(crate) syntax: SyntaxNode,
518}
519impl ast::HasAttrs for ExternCrate {}
520impl ast::HasDocComments for ExternCrate {}
521impl ast::HasVisibility for ExternCrate {}
522impl ExternCrate {
523 #[inline]
524 pub fn name_ref(&self) -> Option<NameRef> { support::child(&self.syntax) }
525 #[inline]
526 pub fn rename(&self) -> Option<Rename> { support::child(&self.syntax) }
527 #[inline]
528 pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) }
529 #[inline]
530 pub fn crate_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![crate]) }
531 #[inline]
532 pub fn extern_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![extern]) }
533}
534pub struct ExternItemList {
535 pub(crate) syntax: SyntaxNode,
536}
537impl ast::HasAttrs for ExternItemList {}
538impl ExternItemList {
539 #[inline]
540 pub fn extern_items(&self) -> AstChildren<ExternItem> { support::children(&self.syntax) }
541 #[inline]
542 pub fn l_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['{']) }
543 #[inline]
544 pub fn r_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['}']) }
545}
546pub struct FieldExpr {
547 pub(crate) syntax: SyntaxNode,
548}
549impl ast::HasAttrs for FieldExpr {}
550impl FieldExpr {
551 #[inline]
552 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
553 #[inline]
554 pub fn name_ref(&self) -> Option<NameRef> { support::child(&self.syntax) }
555 #[inline]
556 pub fn dot_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![.]) }
557}
558pub struct Fn {
559 pub(crate) syntax: SyntaxNode,
560}
561impl ast::HasAttrs for Fn {}
562impl ast::HasDocComments for Fn {}
563impl ast::HasGenericParams for Fn {}
564impl ast::HasName for Fn {}
565impl ast::HasVisibility for Fn {}
566impl Fn {
567 #[inline]
568 pub fn abi(&self) -> Option<Abi> { support::child(&self.syntax) }
569 #[inline]
570 pub fn param_list(&self) -> Option<ParamList> { support::child(&self.syntax) }
571 #[inline]
572 pub fn ret_type(&self) -> Option<RetType> { support::child(&self.syntax) }
573 #[inline]
574 pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) }
575 #[inline]
576 pub fn async_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![async]) }
577 #[inline]
578 pub fn const_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![const]) }
579 #[inline]
580 pub fn default_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![default]) }
581 #[inline]
582 pub fn fn_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![fn]) }
583 #[inline]
584 pub fn gen_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![gen]) }
585 #[inline]
586 pub fn safe_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![safe]) }
587 #[inline]
588 pub fn unsafe_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![unsafe]) }
589}
590pub struct FnPtrType {
591 pub(crate) syntax: SyntaxNode,
592}
593impl FnPtrType {
594 #[inline]
595 pub fn abi(&self) -> Option<Abi> { support::child(&self.syntax) }
596 #[inline]
597 pub fn param_list(&self) -> Option<ParamList> { support::child(&self.syntax) }
598 #[inline]
599 pub fn ret_type(&self) -> Option<RetType> { support::child(&self.syntax) }
600 #[inline]
601 pub fn async_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![async]) }
602 #[inline]
603 pub fn const_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![const]) }
604 #[inline]
605 pub fn fn_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![fn]) }
606 #[inline]
607 pub fn unsafe_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![unsafe]) }
608}
609pub struct ForBinder {
610 pub(crate) syntax: SyntaxNode,
611}
612impl ForBinder {
613 #[inline]
614 pub fn generic_param_list(&self) -> Option<GenericParamList> { support::child(&self.syntax) }
615 #[inline]
616 pub fn for_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![for]) }
617}
618pub struct ForExpr {
619 pub(crate) syntax: SyntaxNode,
620}
621impl ast::HasAttrs for ForExpr {}
622impl ForExpr {
623 #[inline]
624 pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) }
625 #[inline]
626 pub fn for_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![for]) }
627 #[inline]
628 pub fn in_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![in]) }
629}
630pub struct ForType {
631 pub(crate) syntax: SyntaxNode,
632}
633impl ForType {
634 #[inline]
635 pub fn for_binder(&self) -> Option<ForBinder> { support::child(&self.syntax) }
636 #[inline]
637 pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) }
638}
639pub struct FormatArgsArg {
640 pub(crate) syntax: SyntaxNode,
641}
642impl ast::HasName for FormatArgsArg {}
643impl FormatArgsArg {
644 #[inline]
645 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
646 #[inline]
647 pub fn eq_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=]) }
648}
649pub struct FormatArgsExpr {
650 pub(crate) syntax: SyntaxNode,
651}
652impl ast::HasAttrs for FormatArgsExpr {}
653impl FormatArgsExpr {
654 #[inline]
655 pub fn template(&self) -> Option<Expr> { support::child(&self.syntax) }
656 #[inline]
657 pub fn pound_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![#]) }
658 #[inline]
659 pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['(']) }
660 #[inline]
661 pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) }
662 #[inline]
663 pub fn comma_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![,]) }
664 #[inline]
665 pub fn builtin_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![builtin]) }
666 #[inline]
667 pub fn format_args_token(&self) -> Option<SyntaxToken> {
668 support::token(&self.syntax, T![format_args])
669 }
670}
671pub struct GenericArgList {
672 pub(crate) syntax: SyntaxNode,
673}
674impl GenericArgList {
675 #[inline]
676 pub fn generic_args(&self) -> AstChildren<GenericArg> { support::children(&self.syntax) }
677 #[inline]
678 pub fn coloncolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![::]) }
679 #[inline]
680 pub fn l_angle_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![<]) }
681 #[inline]
682 pub fn r_angle_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![>]) }
683}
684pub struct GenericParamList {
685 pub(crate) syntax: SyntaxNode,
686}
687impl GenericParamList {
688 #[inline]
689 pub fn generic_params(&self) -> AstChildren<GenericParam> { support::children(&self.syntax) }
690 #[inline]
691 pub fn l_angle_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![<]) }
692 #[inline]
693 pub fn r_angle_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![>]) }
694}
695pub struct IdentPat {
696 pub(crate) syntax: SyntaxNode,
697}
698impl ast::HasAttrs for IdentPat {}
699impl ast::HasName for IdentPat {}
700impl IdentPat {
701 #[inline]
702 pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) }
703 #[inline]
704 pub fn at_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![@]) }
705 #[inline]
706 pub fn mut_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![mut]) }
707 #[inline]
708 pub fn ref_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![ref]) }
709}
710pub struct IfExpr {
711 pub(crate) syntax: SyntaxNode,
712}
713impl ast::HasAttrs for IfExpr {}
714impl IfExpr {
715 #[inline]
716 pub fn else_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![else]) }
717 #[inline]
718 pub fn if_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![if]) }
719}
720pub struct Impl {
721 pub(crate) syntax: SyntaxNode,
722}
723impl ast::HasAttrs for Impl {}
724impl ast::HasDocComments for Impl {}
725impl ast::HasGenericParams for Impl {}
726impl ast::HasVisibility for Impl {}
727impl Impl {
728 #[inline]
729 pub fn assoc_item_list(&self) -> Option<AssocItemList> { support::child(&self.syntax) }
730 #[inline]
731 pub fn excl_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![!]) }
732 #[inline]
733 pub fn const_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![const]) }
734 #[inline]
735 pub fn default_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![default]) }
736 #[inline]
737 pub fn for_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![for]) }
738 #[inline]
739 pub fn impl_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![impl]) }
740 #[inline]
741 pub fn unsafe_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![unsafe]) }
742}
743pub struct ImplTraitType {
744 pub(crate) syntax: SyntaxNode,
745}
746impl ImplTraitType {
747 #[inline]
748 pub fn type_bound_list(&self) -> Option<TypeBoundList> { support::child(&self.syntax) }
749 #[inline]
750 pub fn impl_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![impl]) }
751}
752pub struct IndexExpr {
753 pub(crate) syntax: SyntaxNode,
754}
755impl ast::HasAttrs for IndexExpr {}
756impl IndexExpr {
757 #[inline]
758 pub fn l_brack_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['[']) }
759 #[inline]
760 pub fn r_brack_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![']']) }
761}
762pub struct InferType {
763 pub(crate) syntax: SyntaxNode,
764}
765impl InferType {
766 #[inline]
767 pub fn underscore_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![_]) }
768}
769pub struct ItemList {
770 pub(crate) syntax: SyntaxNode,
771}
772impl ast::HasAttrs for ItemList {}
773impl ast::HasModuleItem for ItemList {}
774impl ItemList {
775 #[inline]
776 pub fn l_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['{']) }
777 #[inline]
778 pub fn r_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['}']) }
779}
780pub struct Label {
781 pub(crate) syntax: SyntaxNode,
782}
783impl Label {
784 #[inline]
785 pub fn lifetime(&self) -> Option<Lifetime> { support::child(&self.syntax) }
786 #[inline]
787 pub fn colon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![:]) }
788}
789pub struct LetElse {
790 pub(crate) syntax: SyntaxNode,
791}
792impl LetElse {
793 #[inline]
794 pub fn block_expr(&self) -> Option<BlockExpr> { support::child(&self.syntax) }
795 #[inline]
796 pub fn else_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![else]) }
797}
798pub struct LetExpr {
799 pub(crate) syntax: SyntaxNode,
800}
801impl ast::HasAttrs for LetExpr {}
802impl LetExpr {
803 #[inline]
804 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
805 #[inline]
806 pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) }
807 #[inline]
808 pub fn eq_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=]) }
809 #[inline]
810 pub fn let_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![let]) }
811}
812pub struct LetStmt {
813 pub(crate) syntax: SyntaxNode,
814}
815impl ast::HasAttrs for LetStmt {}
816impl LetStmt {
817 #[inline]
818 pub fn initializer(&self) -> Option<Expr> { support::child(&self.syntax) }
819 #[inline]
820 pub fn let_else(&self) -> Option<LetElse> { support::child(&self.syntax) }
821 #[inline]
822 pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) }
823 #[inline]
824 pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) }
825 #[inline]
826 pub fn colon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![:]) }
827 #[inline]
828 pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) }
829 #[inline]
830 pub fn eq_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=]) }
831 #[inline]
832 pub fn let_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![let]) }
833 #[inline]
834 pub fn super_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![super]) }
835}
836pub struct Lifetime {
837 pub(crate) syntax: SyntaxNode,
838}
839impl Lifetime {
840 #[inline]
841 pub fn lifetime_ident_token(&self) -> Option<SyntaxToken> {
842 support::token(&self.syntax, T![lifetime_ident])
843 }
844}
845pub struct LifetimeArg {
846 pub(crate) syntax: SyntaxNode,
847}
848impl LifetimeArg {
849 #[inline]
850 pub fn lifetime(&self) -> Option<Lifetime> { support::child(&self.syntax) }
851}
852pub struct LifetimeParam {
853 pub(crate) syntax: SyntaxNode,
854}
855impl ast::HasAttrs for LifetimeParam {}
856impl ast::HasTypeBounds for LifetimeParam {}
857impl LifetimeParam {
858 #[inline]
859 pub fn lifetime(&self) -> Option<Lifetime> { support::child(&self.syntax) }
860}
861pub struct Literal {
862 pub(crate) syntax: SyntaxNode,
863}
864impl ast::HasAttrs for Literal {}
865impl Literal {}
866pub struct LiteralPat {
867 pub(crate) syntax: SyntaxNode,
868}
869impl LiteralPat {
870 #[inline]
871 pub fn literal(&self) -> Option<Literal> { support::child(&self.syntax) }
872 #[inline]
873 pub fn minus_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![-]) }
874}
875pub struct LoopExpr {
876 pub(crate) syntax: SyntaxNode,
877}
878impl ast::HasAttrs for LoopExpr {}
879impl ast::HasLoopBody for LoopExpr {}
880impl LoopExpr {
881 #[inline]
882 pub fn loop_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![loop]) }
883}
884pub struct MacroCall {
885 pub(crate) syntax: SyntaxNode,
886}
887impl ast::HasAttrs for MacroCall {}
888impl ast::HasDocComments for MacroCall {}
889impl MacroCall {
890 #[inline]
891 pub fn path(&self) -> Option<Path> { support::child(&self.syntax) }
892 #[inline]
893 pub fn token_tree(&self) -> Option<TokenTree> { support::child(&self.syntax) }
894 #[inline]
895 pub fn excl_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![!]) }
896 #[inline]
897 pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) }
898}
899pub struct MacroDef {
900 pub(crate) syntax: SyntaxNode,
901}
902impl ast::HasAttrs for MacroDef {}
903impl ast::HasDocComments for MacroDef {}
904impl ast::HasName for MacroDef {}
905impl ast::HasVisibility for MacroDef {}
906impl MacroDef {
907 #[inline]
908 pub fn macro_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![macro]) }
909}
910pub struct MacroExpr {
911 pub(crate) syntax: SyntaxNode,
912}
913impl MacroExpr {
914 #[inline]
915 pub fn macro_call(&self) -> Option<MacroCall> { support::child(&self.syntax) }
916}
917pub struct MacroItems {
918 pub(crate) syntax: SyntaxNode,
919}
920impl ast::HasModuleItem for MacroItems {}
921impl MacroItems {}
922pub struct MacroPat {
923 pub(crate) syntax: SyntaxNode,
924}
925impl MacroPat {
926 #[inline]
927 pub fn macro_call(&self) -> Option<MacroCall> { support::child(&self.syntax) }
928}
929pub struct MacroRules {
930 pub(crate) syntax: SyntaxNode,
931}
932impl ast::HasAttrs for MacroRules {}
933impl ast::HasDocComments for MacroRules {}
934impl ast::HasName for MacroRules {}
935impl ast::HasVisibility for MacroRules {}
936impl MacroRules {
937 #[inline]
938 pub fn token_tree(&self) -> Option<TokenTree> { support::child(&self.syntax) }
939 #[inline]
940 pub fn excl_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![!]) }
941 #[inline]
942 pub fn macro_rules_token(&self) -> Option<SyntaxToken> {
943 support::token(&self.syntax, T![macro_rules])
944 }
945}
946pub struct MacroStmts {
947 pub(crate) syntax: SyntaxNode,
948}
949impl MacroStmts {
950 #[inline]
951 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
952 #[inline]
953 pub fn statements(&self) -> AstChildren<Stmt> { support::children(&self.syntax) }
954}
955pub struct MacroType {
956 pub(crate) syntax: SyntaxNode,
957}
958impl MacroType {
959 #[inline]
960 pub fn macro_call(&self) -> Option<MacroCall> { support::child(&self.syntax) }
961}
962pub struct MatchArm {
963 pub(crate) syntax: SyntaxNode,
964}
965impl ast::HasAttrs for MatchArm {}
966impl MatchArm {
967 #[inline]
968 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
969 #[inline]
970 pub fn guard(&self) -> Option<MatchGuard> { support::child(&self.syntax) }
971 #[inline]
972 pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) }
973 #[inline]
974 pub fn comma_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![,]) }
975 #[inline]
976 pub fn fat_arrow_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=>]) }
977}
978pub struct MatchArmList {
979 pub(crate) syntax: SyntaxNode,
980}
981impl ast::HasAttrs for MatchArmList {}
982impl MatchArmList {
983 #[inline]
984 pub fn arms(&self) -> AstChildren<MatchArm> { support::children(&self.syntax) }
985 #[inline]
986 pub fn l_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['{']) }
987 #[inline]
988 pub fn r_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['}']) }
989}
990pub struct MatchExpr {
991 pub(crate) syntax: SyntaxNode,
992}
993impl ast::HasAttrs for MatchExpr {}
994impl MatchExpr {
995 #[inline]
996 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
997 #[inline]
998 pub fn match_arm_list(&self) -> Option<MatchArmList> { support::child(&self.syntax) }
999 #[inline]
1000 pub fn match_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![match]) }
1001}
1002pub struct MatchGuard {
1003 pub(crate) syntax: SyntaxNode,
1004}
1005impl MatchGuard {
1006 #[inline]
1007 pub fn if_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![if]) }
1008}
1009pub struct Meta {
1010 pub(crate) syntax: SyntaxNode,
1011}
1012impl Meta {
1013 #[inline]
1014 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
1015 #[inline]
1016 pub fn path(&self) -> Option<Path> { support::child(&self.syntax) }
1017 #[inline]
1018 pub fn token_tree(&self) -> Option<TokenTree> { support::child(&self.syntax) }
1019 #[inline]
1020 pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['(']) }
1021 #[inline]
1022 pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) }
1023 #[inline]
1024 pub fn eq_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=]) }
1025 #[inline]
1026 pub fn unsafe_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![unsafe]) }
1027}
1028pub struct MethodCallExpr {
1029 pub(crate) syntax: SyntaxNode,
1030}
1031impl ast::HasArgList for MethodCallExpr {}
1032impl ast::HasAttrs for MethodCallExpr {}
1033impl ast::HasGenericArgs for MethodCallExpr {}
1034impl MethodCallExpr {
1035 #[inline]
1036 pub fn name_ref(&self) -> Option<NameRef> { support::child(&self.syntax) }
1037 #[inline]
1038 pub fn receiver(&self) -> Option<Expr> { support::child(&self.syntax) }
1039 #[inline]
1040 pub fn dot_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![.]) }
1041}
1042pub struct Module {
1043 pub(crate) syntax: SyntaxNode,
1044}
1045impl ast::HasAttrs for Module {}
1046impl ast::HasDocComments for Module {}
1047impl ast::HasName for Module {}
1048impl ast::HasVisibility for Module {}
1049impl Module {
1050 #[inline]
1051 pub fn item_list(&self) -> Option<ItemList> { support::child(&self.syntax) }
1052 #[inline]
1053 pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) }
1054 #[inline]
1055 pub fn mod_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![mod]) }
1056}
1057pub struct Name {
1058 pub(crate) syntax: SyntaxNode,
1059}
1060impl Name {
1061 #[inline]
1062 pub fn ident_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![ident]) }
1063 #[inline]
1064 pub fn self_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![self]) }
1065}
1066pub struct NameRef {
1067 pub(crate) syntax: SyntaxNode,
1068}
1069impl NameRef {
1070 #[inline]
1071 pub fn Self_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![Self]) }
1072 #[inline]
1073 pub fn crate_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![crate]) }
1074 #[inline]
1075 pub fn ident_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![ident]) }
1076 #[inline]
1077 pub fn int_number_token(&self) -> Option<SyntaxToken> {
1078 support::token(&self.syntax, T![int_number])
1079 }
1080 #[inline]
1081 pub fn self_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![self]) }
1082 #[inline]
1083 pub fn super_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![super]) }
1084}
1085pub struct NeverType {
1086 pub(crate) syntax: SyntaxNode,
1087}
1088impl NeverType {
1089 #[inline]
1090 pub fn excl_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![!]) }
1091}
1092pub struct OffsetOfExpr {
1093 pub(crate) syntax: SyntaxNode,
1094}
1095impl ast::HasAttrs for OffsetOfExpr {}
1096impl OffsetOfExpr {
1097 #[inline]
1098 pub fn fields(&self) -> AstChildren<NameRef> { support::children(&self.syntax) }
1099 #[inline]
1100 pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) }
1101 #[inline]
1102 pub fn pound_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![#]) }
1103 #[inline]
1104 pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['(']) }
1105 #[inline]
1106 pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) }
1107 #[inline]
1108 pub fn comma_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![,]) }
1109 #[inline]
1110 pub fn builtin_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![builtin]) }
1111 #[inline]
1112 pub fn offset_of_token(&self) -> Option<SyntaxToken> {
1113 support::token(&self.syntax, T![offset_of])
1114 }
1115}
1116pub struct OrPat {
1117 pub(crate) syntax: SyntaxNode,
1118}
1119impl OrPat {
1120 #[inline]
1121 pub fn pats(&self) -> AstChildren<Pat> { support::children(&self.syntax) }
1122 #[inline]
1123 pub fn pipe_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![|]) }
1124}
1125pub struct Param {
1126 pub(crate) syntax: SyntaxNode,
1127}
1128impl ast::HasAttrs for Param {}
1129impl Param {
1130 #[inline]
1131 pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) }
1132 #[inline]
1133 pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) }
1134 #[inline]
1135 pub fn dotdotdot_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![...]) }
1136 #[inline]
1137 pub fn colon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![:]) }
1138}
1139pub struct ParamList {
1140 pub(crate) syntax: SyntaxNode,
1141}
1142impl ParamList {
1143 #[inline]
1144 pub fn params(&self) -> AstChildren<Param> { support::children(&self.syntax) }
1145 #[inline]
1146 pub fn self_param(&self) -> Option<SelfParam> { support::child(&self.syntax) }
1147 #[inline]
1148 pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['(']) }
1149 #[inline]
1150 pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) }
1151 #[inline]
1152 pub fn comma_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![,]) }
1153 #[inline]
1154 pub fn pipe_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![|]) }
1155}
1156pub struct ParenExpr {
1157 pub(crate) syntax: SyntaxNode,
1158}
1159impl ast::HasAttrs for ParenExpr {}
1160impl ParenExpr {
1161 #[inline]
1162 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
1163 #[inline]
1164 pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['(']) }
1165 #[inline]
1166 pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) }
1167}
1168pub struct ParenPat {
1169 pub(crate) syntax: SyntaxNode,
1170}
1171impl ParenPat {
1172 #[inline]
1173 pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) }
1174 #[inline]
1175 pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['(']) }
1176 #[inline]
1177 pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) }
1178}
1179pub struct ParenType {
1180 pub(crate) syntax: SyntaxNode,
1181}
1182impl ParenType {
1183 #[inline]
1184 pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) }
1185 #[inline]
1186 pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['(']) }
1187 #[inline]
1188 pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) }
1189}
1190pub struct ParenthesizedArgList {
1191 pub(crate) syntax: SyntaxNode,
1192}
1193impl ParenthesizedArgList {
1194 #[inline]
1195 pub fn type_args(&self) -> AstChildren<TypeArg> { support::children(&self.syntax) }
1196 #[inline]
1197 pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['(']) }
1198 #[inline]
1199 pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) }
1200 #[inline]
1201 pub fn coloncolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![::]) }
1202}
1203pub struct Path {
1204 pub(crate) syntax: SyntaxNode,
1205}
1206impl Path {
1207 #[inline]
1208 pub fn qualifier(&self) -> Option<Path> { support::child(&self.syntax) }
1209 #[inline]
1210 pub fn segment(&self) -> Option<PathSegment> { support::child(&self.syntax) }
1211 #[inline]
1212 pub fn coloncolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![::]) }
1213}
1214pub struct PathExpr {
1215 pub(crate) syntax: SyntaxNode,
1216}
1217impl ast::HasAttrs for PathExpr {}
1218impl PathExpr {
1219 #[inline]
1220 pub fn path(&self) -> Option<Path> { support::child(&self.syntax) }
1221}
1222pub struct PathPat {
1223 pub(crate) syntax: SyntaxNode,
1224}
1225impl PathPat {
1226 #[inline]
1227 pub fn path(&self) -> Option<Path> { support::child(&self.syntax) }
1228}
1229pub struct PathSegment {
1230 pub(crate) syntax: SyntaxNode,
1231}
1232impl ast::HasGenericArgs for PathSegment {}
1233impl PathSegment {
1234 #[inline]
1235 pub fn name_ref(&self) -> Option<NameRef> { support::child(&self.syntax) }
1236 #[inline]
1237 pub fn parenthesized_arg_list(&self) -> Option<ParenthesizedArgList> {
1238 support::child(&self.syntax)
1239 }
1240 #[inline]
1241 pub fn ret_type(&self) -> Option<RetType> { support::child(&self.syntax) }
1242 #[inline]
1243 pub fn return_type_syntax(&self) -> Option<ReturnTypeSyntax> { support::child(&self.syntax) }
1244 #[inline]
1245 pub fn type_anchor(&self) -> Option<TypeAnchor> { support::child(&self.syntax) }
1246 #[inline]
1247 pub fn coloncolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![::]) }
1248}
1249pub struct PathType {
1250 pub(crate) syntax: SyntaxNode,
1251}
1252impl PathType {
1253 #[inline]
1254 pub fn path(&self) -> Option<Path> { support::child(&self.syntax) }
1255}
1256pub struct PrefixExpr {
1257 pub(crate) syntax: SyntaxNode,
1258}
1259impl ast::HasAttrs for PrefixExpr {}
1260impl PrefixExpr {
1261 #[inline]
1262 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
1263}
1264pub struct PtrType {
1265 pub(crate) syntax: SyntaxNode,
1266}
1267impl PtrType {
1268 #[inline]
1269 pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) }
1270 #[inline]
1271 pub fn star_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![*]) }
1272 #[inline]
1273 pub fn const_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![const]) }
1274 #[inline]
1275 pub fn mut_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![mut]) }
1276}
1277pub struct RangeExpr {
1278 pub(crate) syntax: SyntaxNode,
1279}
1280impl ast::HasAttrs for RangeExpr {}
1281impl RangeExpr {}
1282pub struct RangePat {
1283 pub(crate) syntax: SyntaxNode,
1284}
1285impl RangePat {}
1286pub struct RecordExpr {
1287 pub(crate) syntax: SyntaxNode,
1288}
1289impl RecordExpr {
1290 #[inline]
1291 pub fn path(&self) -> Option<Path> { support::child(&self.syntax) }
1292 #[inline]
1293 pub fn record_expr_field_list(&self) -> Option<RecordExprFieldList> {
1294 support::child(&self.syntax)
1295 }
1296}
1297pub struct RecordExprField {
1298 pub(crate) syntax: SyntaxNode,
1299}
1300impl ast::HasAttrs for RecordExprField {}
1301impl RecordExprField {
1302 #[inline]
1303 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
1304 #[inline]
1305 pub fn name_ref(&self) -> Option<NameRef> { support::child(&self.syntax) }
1306 #[inline]
1307 pub fn colon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![:]) }
1308}
1309pub struct RecordExprFieldList {
1310 pub(crate) syntax: SyntaxNode,
1311}
1312impl ast::HasAttrs for RecordExprFieldList {}
1313impl RecordExprFieldList {
1314 #[inline]
1315 pub fn fields(&self) -> AstChildren<RecordExprField> { support::children(&self.syntax) }
1316 #[inline]
1317 pub fn spread(&self) -> Option<Expr> { support::child(&self.syntax) }
1318 #[inline]
1319 pub fn l_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['{']) }
1320 #[inline]
1321 pub fn r_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['}']) }
1322 #[inline]
1323 pub fn dotdot_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![..]) }
1324}
1325pub struct RecordField {
1326 pub(crate) syntax: SyntaxNode,
1327}
1328impl ast::HasAttrs for RecordField {}
1329impl ast::HasDocComments for RecordField {}
1330impl ast::HasName for RecordField {}
1331impl ast::HasVisibility for RecordField {}
1332impl RecordField {
1333 #[inline]
1334 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
1335 #[inline]
1336 pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) }
1337 #[inline]
1338 pub fn colon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![:]) }
1339 #[inline]
1340 pub fn eq_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=]) }
1341 #[inline]
1342 pub fn unsafe_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![unsafe]) }
1343}
1344pub struct RecordFieldList {
1345 pub(crate) syntax: SyntaxNode,
1346}
1347impl RecordFieldList {
1348 #[inline]
1349 pub fn fields(&self) -> AstChildren<RecordField> { support::children(&self.syntax) }
1350 #[inline]
1351 pub fn l_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['{']) }
1352 #[inline]
1353 pub fn r_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['}']) }
1354}
1355pub struct RecordPat {
1356 pub(crate) syntax: SyntaxNode,
1357}
1358impl RecordPat {
1359 #[inline]
1360 pub fn path(&self) -> Option<Path> { support::child(&self.syntax) }
1361 #[inline]
1362 pub fn record_pat_field_list(&self) -> Option<RecordPatFieldList> {
1363 support::child(&self.syntax)
1364 }
1365}
1366pub struct RecordPatField {
1367 pub(crate) syntax: SyntaxNode,
1368}
1369impl ast::HasAttrs for RecordPatField {}
1370impl RecordPatField {
1371 #[inline]
1372 pub fn name_ref(&self) -> Option<NameRef> { support::child(&self.syntax) }
1373 #[inline]
1374 pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) }
1375 #[inline]
1376 pub fn colon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![:]) }
1377}
1378pub struct RecordPatFieldList {
1379 pub(crate) syntax: SyntaxNode,
1380}
1381impl RecordPatFieldList {
1382 #[inline]
1383 pub fn fields(&self) -> AstChildren<RecordPatField> { support::children(&self.syntax) }
1384 #[inline]
1385 pub fn rest_pat(&self) -> Option<RestPat> { support::child(&self.syntax) }
1386 #[inline]
1387 pub fn l_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['{']) }
1388 #[inline]
1389 pub fn r_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['}']) }
1390}
1391pub struct RefExpr {
1392 pub(crate) syntax: SyntaxNode,
1393}
1394impl ast::HasAttrs for RefExpr {}
1395impl RefExpr {
1396 #[inline]
1397 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
1398 #[inline]
1399 pub fn amp_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![&]) }
1400 #[inline]
1401 pub fn const_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![const]) }
1402 #[inline]
1403 pub fn mut_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![mut]) }
1404 #[inline]
1405 pub fn raw_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![raw]) }
1406}
1407pub struct RefPat {
1408 pub(crate) syntax: SyntaxNode,
1409}
1410impl RefPat {
1411 #[inline]
1412 pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) }
1413 #[inline]
1414 pub fn amp_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![&]) }
1415 #[inline]
1416 pub fn mut_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![mut]) }
1417}
1418pub struct RefType {
1419 pub(crate) syntax: SyntaxNode,
1420}
1421impl RefType {
1422 #[inline]
1423 pub fn lifetime(&self) -> Option<Lifetime> { support::child(&self.syntax) }
1424 #[inline]
1425 pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) }
1426 #[inline]
1427 pub fn amp_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![&]) }
1428 #[inline]
1429 pub fn mut_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![mut]) }
1430}
1431pub struct Rename {
1432 pub(crate) syntax: SyntaxNode,
1433}
1434impl ast::HasName for Rename {}
1435impl Rename {
1436 #[inline]
1437 pub fn underscore_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![_]) }
1438 #[inline]
1439 pub fn as_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![as]) }
1440}
1441pub struct RestPat {
1442 pub(crate) syntax: SyntaxNode,
1443}
1444impl ast::HasAttrs for RestPat {}
1445impl RestPat {
1446 #[inline]
1447 pub fn dotdot_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![..]) }
1448}
1449pub struct RetType {
1450 pub(crate) syntax: SyntaxNode,
1451}
1452impl RetType {
1453 #[inline]
1454 pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) }
1455 #[inline]
1456 pub fn thin_arrow_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![->]) }
1457}
1458pub struct ReturnExpr {
1459 pub(crate) syntax: SyntaxNode,
1460}
1461impl ast::HasAttrs for ReturnExpr {}
1462impl ReturnExpr {
1463 #[inline]
1464 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
1465 #[inline]
1466 pub fn return_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![return]) }
1467}
1468pub struct ReturnTypeSyntax {
1469 pub(crate) syntax: SyntaxNode,
1470}
1471impl ReturnTypeSyntax {
1472 #[inline]
1473 pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['(']) }
1474 #[inline]
1475 pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) }
1476 #[inline]
1477 pub fn dotdot_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![..]) }
1478}
1479pub struct SelfParam {
1480 pub(crate) syntax: SyntaxNode,
1481}
1482impl ast::HasAttrs for SelfParam {}
1483impl ast::HasName for SelfParam {}
1484impl SelfParam {
1485 #[inline]
1486 pub fn lifetime(&self) -> Option<Lifetime> { support::child(&self.syntax) }
1487 #[inline]
1488 pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) }
1489 #[inline]
1490 pub fn amp_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![&]) }
1491 #[inline]
1492 pub fn colon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![:]) }
1493 #[inline]
1494 pub fn mut_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![mut]) }
1495}
1496pub struct SlicePat {
1497 pub(crate) syntax: SyntaxNode,
1498}
1499impl SlicePat {
1500 #[inline]
1501 pub fn pats(&self) -> AstChildren<Pat> { support::children(&self.syntax) }
1502 #[inline]
1503 pub fn l_brack_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['[']) }
1504 #[inline]
1505 pub fn r_brack_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![']']) }
1506}
1507pub struct SliceType {
1508 pub(crate) syntax: SyntaxNode,
1509}
1510impl SliceType {
1511 #[inline]
1512 pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) }
1513 #[inline]
1514 pub fn l_brack_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['[']) }
1515 #[inline]
1516 pub fn r_brack_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![']']) }
1517}
1518pub struct SourceFile {
1519 pub(crate) syntax: SyntaxNode,
1520}
1521impl ast::HasAttrs for SourceFile {}
1522impl ast::HasDocComments for SourceFile {}
1523impl ast::HasModuleItem for SourceFile {}
1524impl SourceFile {
1525 #[inline]
1526 pub fn frontmatter_token(&self) -> Option<SyntaxToken> {
1527 support::token(&self.syntax, T![frontmatter])
1528 }
1529 #[inline]
1530 pub fn shebang_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![shebang]) }
1531}
1532pub struct Static {
1533 pub(crate) syntax: SyntaxNode,
1534}
1535impl ast::HasAttrs for Static {}
1536impl ast::HasDocComments for Static {}
1537impl ast::HasName for Static {}
1538impl ast::HasVisibility for Static {}
1539impl Static {
1540 #[inline]
1541 pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) }
1542 #[inline]
1543 pub fn colon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![:]) }
1544 #[inline]
1545 pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) }
1546 #[inline]
1547 pub fn eq_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=]) }
1548 #[inline]
1549 pub fn mut_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![mut]) }
1550 #[inline]
1551 pub fn safe_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![safe]) }
1552 #[inline]
1553 pub fn static_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![static]) }
1554 #[inline]
1555 pub fn unsafe_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![unsafe]) }
1556}
1557pub struct StmtList {
1558 pub(crate) syntax: SyntaxNode,
1559}
1560impl ast::HasAttrs for StmtList {}
1561impl StmtList {
1562 #[inline]
1563 pub fn statements(&self) -> AstChildren<Stmt> { support::children(&self.syntax) }
1564 #[inline]
1565 pub fn tail_expr(&self) -> Option<Expr> { support::child(&self.syntax) }
1566 #[inline]
1567 pub fn l_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['{']) }
1568 #[inline]
1569 pub fn r_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['}']) }
1570}
1571pub struct Struct {
1572 pub(crate) syntax: SyntaxNode,
1573}
1574impl ast::HasAttrs for Struct {}
1575impl ast::HasDocComments for Struct {}
1576impl ast::HasGenericParams for Struct {}
1577impl ast::HasName for Struct {}
1578impl ast::HasVisibility for Struct {}
1579impl Struct {
1580 #[inline]
1581 pub fn field_list(&self) -> Option<FieldList> { support::child(&self.syntax) }
1582 #[inline]
1583 pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) }
1584 #[inline]
1585 pub fn struct_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![struct]) }
1586}
1587pub struct TokenTree {
1588 pub(crate) syntax: SyntaxNode,
1589}
1590impl TokenTree {
1591 #[inline]
1592 pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['(']) }
1593 #[inline]
1594 pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) }
1595 #[inline]
1596 pub fn l_brack_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['[']) }
1597 #[inline]
1598 pub fn r_brack_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![']']) }
1599 #[inline]
1600 pub fn l_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['{']) }
1601 #[inline]
1602 pub fn r_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['}']) }
1603}
1604pub struct Trait {
1605 pub(crate) syntax: SyntaxNode,
1606}
1607impl ast::HasAttrs for Trait {}
1608impl ast::HasDocComments for Trait {}
1609impl ast::HasGenericParams for Trait {}
1610impl ast::HasName for Trait {}
1611impl ast::HasTypeBounds for Trait {}
1612impl ast::HasVisibility for Trait {}
1613impl Trait {
1614 #[inline]
1615 pub fn assoc_item_list(&self) -> Option<AssocItemList> { support::child(&self.syntax) }
1616 #[inline]
1617 pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) }
1618 #[inline]
1619 pub fn eq_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=]) }
1620 #[inline]
1621 pub fn auto_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![auto]) }
1622 #[inline]
1623 pub fn trait_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![trait]) }
1624 #[inline]
1625 pub fn unsafe_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![unsafe]) }
1626}
1627pub struct TryExpr {
1628 pub(crate) syntax: SyntaxNode,
1629}
1630impl ast::HasAttrs for TryExpr {}
1631impl TryExpr {
1632 #[inline]
1633 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
1634 #[inline]
1635 pub fn question_mark_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![?]) }
1636}
1637pub struct TupleExpr {
1638 pub(crate) syntax: SyntaxNode,
1639}
1640impl ast::HasAttrs for TupleExpr {}
1641impl TupleExpr {
1642 #[inline]
1643 pub fn fields(&self) -> AstChildren<Expr> { support::children(&self.syntax) }
1644 #[inline]
1645 pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['(']) }
1646 #[inline]
1647 pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) }
1648}
1649pub struct TupleField {
1650 pub(crate) syntax: SyntaxNode,
1651}
1652impl ast::HasAttrs for TupleField {}
1653impl ast::HasDocComments for TupleField {}
1654impl ast::HasVisibility for TupleField {}
1655impl TupleField {
1656 #[inline]
1657 pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) }
1658}
1659pub struct TupleFieldList {
1660 pub(crate) syntax: SyntaxNode,
1661}
1662impl TupleFieldList {
1663 #[inline]
1664 pub fn fields(&self) -> AstChildren<TupleField> { support::children(&self.syntax) }
1665 #[inline]
1666 pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['(']) }
1667 #[inline]
1668 pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) }
1669}
1670pub struct TuplePat {
1671 pub(crate) syntax: SyntaxNode,
1672}
1673impl TuplePat {
1674 #[inline]
1675 pub fn fields(&self) -> AstChildren<Pat> { support::children(&self.syntax) }
1676 #[inline]
1677 pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['(']) }
1678 #[inline]
1679 pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) }
1680}
1681pub struct TupleStructPat {
1682 pub(crate) syntax: SyntaxNode,
1683}
1684impl TupleStructPat {
1685 #[inline]
1686 pub fn fields(&self) -> AstChildren<Pat> { support::children(&self.syntax) }
1687 #[inline]
1688 pub fn path(&self) -> Option<Path> { support::child(&self.syntax) }
1689 #[inline]
1690 pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['(']) }
1691 #[inline]
1692 pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) }
1693}
1694pub struct TupleType {
1695 pub(crate) syntax: SyntaxNode,
1696}
1697impl TupleType {
1698 #[inline]
1699 pub fn fields(&self) -> AstChildren<Type> { support::children(&self.syntax) }
1700 #[inline]
1701 pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['(']) }
1702 #[inline]
1703 pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) }
1704}
1705pub struct TypeAlias {
1706 pub(crate) syntax: SyntaxNode,
1707}
1708impl ast::HasAttrs for TypeAlias {}
1709impl ast::HasDocComments for TypeAlias {}
1710impl ast::HasGenericParams for TypeAlias {}
1711impl ast::HasName for TypeAlias {}
1712impl ast::HasTypeBounds for TypeAlias {}
1713impl ast::HasVisibility for TypeAlias {}
1714impl TypeAlias {
1715 #[inline]
1716 pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) }
1717 #[inline]
1718 pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) }
1719 #[inline]
1720 pub fn eq_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=]) }
1721 #[inline]
1722 pub fn default_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![default]) }
1723 #[inline]
1724 pub fn type_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![type]) }
1725}
1726pub struct TypeAnchor {
1727 pub(crate) syntax: SyntaxNode,
1728}
1729impl TypeAnchor {
1730 #[inline]
1731 pub fn path_type(&self) -> Option<PathType> { support::child(&self.syntax) }
1732 #[inline]
1733 pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) }
1734 #[inline]
1735 pub fn l_angle_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![<]) }
1736 #[inline]
1737 pub fn r_angle_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![>]) }
1738 #[inline]
1739 pub fn as_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![as]) }
1740}
1741pub struct TypeArg {
1742 pub(crate) syntax: SyntaxNode,
1743}
1744impl TypeArg {
1745 #[inline]
1746 pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) }
1747}
1748pub struct TypeBound {
1749 pub(crate) syntax: SyntaxNode,
1750}
1751impl TypeBound {
1752 #[inline]
1753 pub fn for_binder(&self) -> Option<ForBinder> { support::child(&self.syntax) }
1754 #[inline]
1755 pub fn lifetime(&self) -> Option<Lifetime> { support::child(&self.syntax) }
1756 #[inline]
1757 pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) }
1758 #[inline]
1759 pub fn use_bound_generic_args(&self) -> Option<UseBoundGenericArgs> {
1760 support::child(&self.syntax)
1761 }
1762 #[inline]
1763 pub fn l_brack_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['[']) }
1764 #[inline]
1765 pub fn r_brack_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![']']) }
1766 #[inline]
1767 pub fn question_mark_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![?]) }
1768 #[inline]
1769 pub fn async_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![async]) }
1770 #[inline]
1771 pub fn const_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![const]) }
1772 #[inline]
1773 pub fn use_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![use]) }
1774 #[inline]
1775 pub fn tilde_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![~]) }
1776}
1777pub struct TypeBoundList {
1778 pub(crate) syntax: SyntaxNode,
1779}
1780impl TypeBoundList {
1781 #[inline]
1782 pub fn bounds(&self) -> AstChildren<TypeBound> { support::children(&self.syntax) }
1783}
1784pub struct TypeParam {
1785 pub(crate) syntax: SyntaxNode,
1786}
1787impl ast::HasAttrs for TypeParam {}
1788impl ast::HasName for TypeParam {}
1789impl ast::HasTypeBounds for TypeParam {}
1790impl TypeParam {
1791 #[inline]
1792 pub fn default_type(&self) -> Option<Type> { support::child(&self.syntax) }
1793 #[inline]
1794 pub fn eq_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=]) }
1795}
1796pub struct UnderscoreExpr {
1797 pub(crate) syntax: SyntaxNode,
1798}
1799impl ast::HasAttrs for UnderscoreExpr {}
1800impl UnderscoreExpr {
1801 #[inline]
1802 pub fn underscore_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![_]) }
1803}
1804pub struct Union {
1805 pub(crate) syntax: SyntaxNode,
1806}
1807impl ast::HasAttrs for Union {}
1808impl ast::HasDocComments for Union {}
1809impl ast::HasGenericParams for Union {}
1810impl ast::HasName for Union {}
1811impl ast::HasVisibility for Union {}
1812impl Union {
1813 #[inline]
1814 pub fn record_field_list(&self) -> Option<RecordFieldList> { support::child(&self.syntax) }
1815 #[inline]
1816 pub fn union_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![union]) }
1817}
1818pub struct Use {
1819 pub(crate) syntax: SyntaxNode,
1820}
1821impl ast::HasAttrs for Use {}
1822impl ast::HasDocComments for Use {}
1823impl ast::HasVisibility for Use {}
1824impl Use {
1825 #[inline]
1826 pub fn use_tree(&self) -> Option<UseTree> { support::child(&self.syntax) }
1827 #[inline]
1828 pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) }
1829 #[inline]
1830 pub fn use_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![use]) }
1831}
1832pub struct UseBoundGenericArgs {
1833 pub(crate) syntax: SyntaxNode,
1834}
1835impl UseBoundGenericArgs {
1836 #[inline]
1837 pub fn use_bound_generic_args(&self) -> AstChildren<UseBoundGenericArg> {
1838 support::children(&self.syntax)
1839 }
1840 #[inline]
1841 pub fn l_angle_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![<]) }
1842 #[inline]
1843 pub fn r_angle_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![>]) }
1844}
1845pub struct UseTree {
1846 pub(crate) syntax: SyntaxNode,
1847}
1848impl UseTree {
1849 #[inline]
1850 pub fn path(&self) -> Option<Path> { support::child(&self.syntax) }
1851 #[inline]
1852 pub fn rename(&self) -> Option<Rename> { support::child(&self.syntax) }
1853 #[inline]
1854 pub fn use_tree_list(&self) -> Option<UseTreeList> { support::child(&self.syntax) }
1855 #[inline]
1856 pub fn star_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![*]) }
1857 #[inline]
1858 pub fn coloncolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![::]) }
1859}
1860pub struct UseTreeList {
1861 pub(crate) syntax: SyntaxNode,
1862}
1863impl UseTreeList {
1864 #[inline]
1865 pub fn use_trees(&self) -> AstChildren<UseTree> { support::children(&self.syntax) }
1866 #[inline]
1867 pub fn l_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['{']) }
1868 #[inline]
1869 pub fn r_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['}']) }
1870}
1871pub struct Variant {
1872 pub(crate) syntax: SyntaxNode,
1873}
1874impl ast::HasAttrs for Variant {}
1875impl ast::HasDocComments for Variant {}
1876impl ast::HasName for Variant {}
1877impl ast::HasVisibility for Variant {}
1878impl Variant {
1879 #[inline]
1880 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
1881 #[inline]
1882 pub fn field_list(&self) -> Option<FieldList> { support::child(&self.syntax) }
1883 #[inline]
1884 pub fn eq_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=]) }
1885}
1886pub struct VariantList {
1887 pub(crate) syntax: SyntaxNode,
1888}
1889impl VariantList {
1890 #[inline]
1891 pub fn variants(&self) -> AstChildren<Variant> { support::children(&self.syntax) }
1892 #[inline]
1893 pub fn l_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['{']) }
1894 #[inline]
1895 pub fn r_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['}']) }
1896}
1897pub struct Visibility {
1898 pub(crate) syntax: SyntaxNode,
1899}
1900impl Visibility {
1901 #[inline]
1902 pub fn path(&self) -> Option<Path> { support::child(&self.syntax) }
1903 #[inline]
1904 pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['(']) }
1905 #[inline]
1906 pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) }
1907 #[inline]
1908 pub fn in_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![in]) }
1909 #[inline]
1910 pub fn pub_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![pub]) }
1911}
1912pub struct WhereClause {
1913 pub(crate) syntax: SyntaxNode,
1914}
1915impl WhereClause {
1916 #[inline]
1917 pub fn predicates(&self) -> AstChildren<WherePred> { support::children(&self.syntax) }
1918 #[inline]
1919 pub fn where_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![where]) }
1920}
1921pub struct WherePred {
1922 pub(crate) syntax: SyntaxNode,
1923}
1924impl ast::HasTypeBounds for WherePred {}
1925impl WherePred {
1926 #[inline]
1927 pub fn for_binder(&self) -> Option<ForBinder> { support::child(&self.syntax) }
1928 #[inline]
1929 pub fn lifetime(&self) -> Option<Lifetime> { support::child(&self.syntax) }
1930 #[inline]
1931 pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) }
1932}
1933pub struct WhileExpr {
1934 pub(crate) syntax: SyntaxNode,
1935}
1936impl ast::HasAttrs for WhileExpr {}
1937impl WhileExpr {
1938 #[inline]
1939 pub fn while_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![while]) }
1940}
1941pub struct WildcardPat {
1942 pub(crate) syntax: SyntaxNode,
1943}
1944impl WildcardPat {
1945 #[inline]
1946 pub fn underscore_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![_]) }
1947}
1948pub struct YeetExpr {
1949 pub(crate) syntax: SyntaxNode,
1950}
1951impl ast::HasAttrs for YeetExpr {}
1952impl YeetExpr {
1953 #[inline]
1954 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
1955 #[inline]
1956 pub fn do_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![do]) }
1957 #[inline]
1958 pub fn yeet_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![yeet]) }
1959}
1960pub struct YieldExpr {
1961 pub(crate) syntax: SyntaxNode,
1962}
1963impl ast::HasAttrs for YieldExpr {}
1964impl YieldExpr {
1965 #[inline]
1966 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
1967 #[inline]
1968 pub fn yield_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![yield]) }
1969}
1970
1971#[derive(Debug, Clone, PartialEq, Eq, Hash)]
1972pub enum Adt {
1973 Enum(Enum),
1974 Struct(Struct),
1975 Union(Union),
1976}
1977impl ast::HasAttrs for Adt {}
1978impl ast::HasDocComments for Adt {}
1979impl ast::HasGenericParams for Adt {}
1980impl ast::HasName for Adt {}
1981impl ast::HasVisibility for Adt {}
1982
1983#[derive(Debug, Clone, PartialEq, Eq, Hash)]
1984pub enum AsmOperand {
1985 AsmConst(AsmConst),
1986 AsmLabel(AsmLabel),
1987 AsmRegOperand(AsmRegOperand),
1988 AsmSym(AsmSym),
1989}
1990
1991#[derive(Debug, Clone, PartialEq, Eq, Hash)]
1992pub enum AsmPiece {
1993 AsmClobberAbi(AsmClobberAbi),
1994 AsmOperandNamed(AsmOperandNamed),
1995 AsmOptions(AsmOptions),
1996}
1997
1998#[derive(Debug, Clone, PartialEq, Eq, Hash)]
1999pub enum AssocItem {
2000 Const(Const),
2001 Fn(Fn),
2002 MacroCall(MacroCall),
2003 TypeAlias(TypeAlias),
2004}
2005impl ast::HasAttrs for AssocItem {}
2006impl ast::HasDocComments for AssocItem {}
2007
2008#[derive(Debug, Clone, PartialEq, Eq, Hash)]
2009pub enum Expr {
2010 ArrayExpr(ArrayExpr),
2011 AsmExpr(AsmExpr),
2012 AwaitExpr(AwaitExpr),
2013 BecomeExpr(BecomeExpr),
2014 BinExpr(BinExpr),
2015 BlockExpr(BlockExpr),
2016 BreakExpr(BreakExpr),
2017 CallExpr(CallExpr),
2018 CastExpr(CastExpr),
2019 ClosureExpr(ClosureExpr),
2020 ContinueExpr(ContinueExpr),
2021 FieldExpr(FieldExpr),
2022 ForExpr(ForExpr),
2023 FormatArgsExpr(FormatArgsExpr),
2024 IfExpr(IfExpr),
2025 IndexExpr(IndexExpr),
2026 LetExpr(LetExpr),
2027 Literal(Literal),
2028 LoopExpr(LoopExpr),
2029 MacroExpr(MacroExpr),
2030 MatchExpr(MatchExpr),
2031 MethodCallExpr(MethodCallExpr),
2032 OffsetOfExpr(OffsetOfExpr),
2033 ParenExpr(ParenExpr),
2034 PathExpr(PathExpr),
2035 PrefixExpr(PrefixExpr),
2036 RangeExpr(RangeExpr),
2037 RecordExpr(RecordExpr),
2038 RefExpr(RefExpr),
2039 ReturnExpr(ReturnExpr),
2040 TryExpr(TryExpr),
2041 TupleExpr(TupleExpr),
2042 UnderscoreExpr(UnderscoreExpr),
2043 WhileExpr(WhileExpr),
2044 YeetExpr(YeetExpr),
2045 YieldExpr(YieldExpr),
2046}
2047
2048#[derive(Debug, Clone, PartialEq, Eq, Hash)]
2049pub enum ExternItem {
2050 Fn(Fn),
2051 MacroCall(MacroCall),
2052 Static(Static),
2053 TypeAlias(TypeAlias),
2054}
2055impl ast::HasAttrs for ExternItem {}
2056impl ast::HasDocComments for ExternItem {}
2057
2058#[derive(Debug, Clone, PartialEq, Eq, Hash)]
2059pub enum FieldList {
2060 RecordFieldList(RecordFieldList),
2061 TupleFieldList(TupleFieldList),
2062}
2063
2064#[derive(Debug, Clone, PartialEq, Eq, Hash)]
2065pub enum GenericArg {
2066 AssocTypeArg(AssocTypeArg),
2067 ConstArg(ConstArg),
2068 LifetimeArg(LifetimeArg),
2069 TypeArg(TypeArg),
2070}
2071
2072#[derive(Debug, Clone, PartialEq, Eq, Hash)]
2073pub enum GenericParam {
2074 ConstParam(ConstParam),
2075 LifetimeParam(LifetimeParam),
2076 TypeParam(TypeParam),
2077}
2078impl ast::HasAttrs for GenericParam {}
2079
2080#[derive(Debug, Clone, PartialEq, Eq, Hash)]
2081pub enum Item {
2082 AsmExpr(AsmExpr),
2083 Const(Const),
2084 Enum(Enum),
2085 ExternBlock(ExternBlock),
2086 ExternCrate(ExternCrate),
2087 Fn(Fn),
2088 Impl(Impl),
2089 MacroCall(MacroCall),
2090 MacroDef(MacroDef),
2091 MacroRules(MacroRules),
2092 Module(Module),
2093 Static(Static),
2094 Struct(Struct),
2095 Trait(Trait),
2096 TypeAlias(TypeAlias),
2097 Union(Union),
2098 Use(Use),
2099}
2100impl ast::HasAttrs for Item {}
2101
2102#[derive(Debug, Clone, PartialEq, Eq, Hash)]
2103pub enum Pat {
2104 BoxPat(BoxPat),
2105 ConstBlockPat(ConstBlockPat),
2106 IdentPat(IdentPat),
2107 LiteralPat(LiteralPat),
2108 MacroPat(MacroPat),
2109 OrPat(OrPat),
2110 ParenPat(ParenPat),
2111 PathPat(PathPat),
2112 RangePat(RangePat),
2113 RecordPat(RecordPat),
2114 RefPat(RefPat),
2115 RestPat(RestPat),
2116 SlicePat(SlicePat),
2117 TuplePat(TuplePat),
2118 TupleStructPat(TupleStructPat),
2119 WildcardPat(WildcardPat),
2120}
2121
2122#[derive(Debug, Clone, PartialEq, Eq, Hash)]
2123pub enum Stmt {
2124 ExprStmt(ExprStmt),
2125 Item(Item),
2126 LetStmt(LetStmt),
2127}
2128
2129#[derive(Debug, Clone, PartialEq, Eq, Hash)]
2130pub enum Type {
2131 ArrayType(ArrayType),
2132 DynTraitType(DynTraitType),
2133 FnPtrType(FnPtrType),
2134 ForType(ForType),
2135 ImplTraitType(ImplTraitType),
2136 InferType(InferType),
2137 MacroType(MacroType),
2138 NeverType(NeverType),
2139 ParenType(ParenType),
2140 PathType(PathType),
2141 PtrType(PtrType),
2142 RefType(RefType),
2143 SliceType(SliceType),
2144 TupleType(TupleType),
2145}
2146
2147#[derive(Debug, Clone, PartialEq, Eq, Hash)]
2148pub enum UseBoundGenericArg {
2149 Lifetime(Lifetime),
2150 NameRef(NameRef),
2151}
2152
2153#[derive(Debug, Clone, PartialEq, Eq, Hash)]
2154pub enum VariantDef {
2155 Struct(Struct),
2156 Union(Union),
2157 Variant(Variant),
2158}
2159impl ast::HasAttrs for VariantDef {}
2160impl ast::HasDocComments for VariantDef {}
2161impl ast::HasName for VariantDef {}
2162impl ast::HasVisibility for VariantDef {}
2163pub struct AnyHasArgList {
2164 pub(crate) syntax: SyntaxNode,
2165}
2166impl AnyHasArgList {
2167 #[inline]
2168 pub fn new<T: ast::HasArgList>(node: T) -> AnyHasArgList {
2169 AnyHasArgList { syntax: node.syntax().clone() }
2170 }
2171}
2172pub struct AnyHasAttrs {
2173 pub(crate) syntax: SyntaxNode,
2174}
2175impl AnyHasAttrs {
2176 #[inline]
2177 pub fn new<T: ast::HasAttrs>(node: T) -> AnyHasAttrs {
2178 AnyHasAttrs { syntax: node.syntax().clone() }
2179 }
2180}
2181pub struct AnyHasDocComments {
2182 pub(crate) syntax: SyntaxNode,
2183}
2184impl AnyHasDocComments {
2185 #[inline]
2186 pub fn new<T: ast::HasDocComments>(node: T) -> AnyHasDocComments {
2187 AnyHasDocComments { syntax: node.syntax().clone() }
2188 }
2189}
2190pub struct AnyHasGenericArgs {
2191 pub(crate) syntax: SyntaxNode,
2192}
2193impl AnyHasGenericArgs {
2194 #[inline]
2195 pub fn new<T: ast::HasGenericArgs>(node: T) -> AnyHasGenericArgs {
2196 AnyHasGenericArgs { syntax: node.syntax().clone() }
2197 }
2198}
2199pub struct AnyHasGenericParams {
2200 pub(crate) syntax: SyntaxNode,
2201}
2202impl AnyHasGenericParams {
2203 #[inline]
2204 pub fn new<T: ast::HasGenericParams>(node: T) -> AnyHasGenericParams {
2205 AnyHasGenericParams { syntax: node.syntax().clone() }
2206 }
2207}
2208pub struct AnyHasLoopBody {
2209 pub(crate) syntax: SyntaxNode,
2210}
2211impl AnyHasLoopBody {
2212 #[inline]
2213 pub fn new<T: ast::HasLoopBody>(node: T) -> AnyHasLoopBody {
2214 AnyHasLoopBody { syntax: node.syntax().clone() }
2215 }
2216}
2217pub struct AnyHasModuleItem {
2218 pub(crate) syntax: SyntaxNode,
2219}
2220impl AnyHasModuleItem {
2221 #[inline]
2222 pub fn new<T: ast::HasModuleItem>(node: T) -> AnyHasModuleItem {
2223 AnyHasModuleItem { syntax: node.syntax().clone() }
2224 }
2225}
2226pub struct AnyHasName {
2227 pub(crate) syntax: SyntaxNode,
2228}
2229impl AnyHasName {
2230 #[inline]
2231 pub fn new<T: ast::HasName>(node: T) -> AnyHasName {
2232 AnyHasName { syntax: node.syntax().clone() }
2233 }
2234}
2235pub struct AnyHasTypeBounds {
2236 pub(crate) syntax: SyntaxNode,
2237}
2238impl AnyHasTypeBounds {
2239 #[inline]
2240 pub fn new<T: ast::HasTypeBounds>(node: T) -> AnyHasTypeBounds {
2241 AnyHasTypeBounds { syntax: node.syntax().clone() }
2242 }
2243}
2244pub struct AnyHasVisibility {
2245 pub(crate) syntax: SyntaxNode,
2246}
2247impl AnyHasVisibility {
2248 #[inline]
2249 pub fn new<T: ast::HasVisibility>(node: T) -> AnyHasVisibility {
2250 AnyHasVisibility { syntax: node.syntax().clone() }
2251 }
2252}
2253impl AstNode for Abi {
2254 #[inline]
2255 fn kind() -> SyntaxKind
2256 where
2257 Self: Sized,
2258 {
2259 ABI
2260 }
2261 #[inline]
2262 fn can_cast(kind: SyntaxKind) -> bool { kind == ABI }
2263 #[inline]
2264 fn cast(syntax: SyntaxNode) -> Option<Self> {
2265 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
2266 }
2267 #[inline]
2268 fn syntax(&self) -> &SyntaxNode { &self.syntax }
2269}
2270impl hash::Hash for Abi {
2271 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
2272}
2273impl Eq for Abi {}
2274impl PartialEq for Abi {
2275 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
2276}
2277impl Clone for Abi {
2278 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
2279}
2280impl fmt::Debug for Abi {
2281 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
2282 f.debug_struct("Abi").field("syntax", &self.syntax).finish()
2283 }
2284}
2285impl AstNode for ArgList {
2286 #[inline]
2287 fn kind() -> SyntaxKind
2288 where
2289 Self: Sized,
2290 {
2291 ARG_LIST
2292 }
2293 #[inline]
2294 fn can_cast(kind: SyntaxKind) -> bool { kind == ARG_LIST }
2295 #[inline]
2296 fn cast(syntax: SyntaxNode) -> Option<Self> {
2297 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
2298 }
2299 #[inline]
2300 fn syntax(&self) -> &SyntaxNode { &self.syntax }
2301}
2302impl hash::Hash for ArgList {
2303 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
2304}
2305impl Eq for ArgList {}
2306impl PartialEq for ArgList {
2307 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
2308}
2309impl Clone for ArgList {
2310 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
2311}
2312impl fmt::Debug for ArgList {
2313 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
2314 f.debug_struct("ArgList").field("syntax", &self.syntax).finish()
2315 }
2316}
2317impl AstNode for ArrayExpr {
2318 #[inline]
2319 fn kind() -> SyntaxKind
2320 where
2321 Self: Sized,
2322 {
2323 ARRAY_EXPR
2324 }
2325 #[inline]
2326 fn can_cast(kind: SyntaxKind) -> bool { kind == ARRAY_EXPR }
2327 #[inline]
2328 fn cast(syntax: SyntaxNode) -> Option<Self> {
2329 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
2330 }
2331 #[inline]
2332 fn syntax(&self) -> &SyntaxNode { &self.syntax }
2333}
2334impl hash::Hash for ArrayExpr {
2335 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
2336}
2337impl Eq for ArrayExpr {}
2338impl PartialEq for ArrayExpr {
2339 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
2340}
2341impl Clone for ArrayExpr {
2342 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
2343}
2344impl fmt::Debug for ArrayExpr {
2345 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
2346 f.debug_struct("ArrayExpr").field("syntax", &self.syntax).finish()
2347 }
2348}
2349impl AstNode for ArrayType {
2350 #[inline]
2351 fn kind() -> SyntaxKind
2352 where
2353 Self: Sized,
2354 {
2355 ARRAY_TYPE
2356 }
2357 #[inline]
2358 fn can_cast(kind: SyntaxKind) -> bool { kind == ARRAY_TYPE }
2359 #[inline]
2360 fn cast(syntax: SyntaxNode) -> Option<Self> {
2361 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
2362 }
2363 #[inline]
2364 fn syntax(&self) -> &SyntaxNode { &self.syntax }
2365}
2366impl hash::Hash for ArrayType {
2367 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
2368}
2369impl Eq for ArrayType {}
2370impl PartialEq for ArrayType {
2371 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
2372}
2373impl Clone for ArrayType {
2374 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
2375}
2376impl fmt::Debug for ArrayType {
2377 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
2378 f.debug_struct("ArrayType").field("syntax", &self.syntax).finish()
2379 }
2380}
2381impl AstNode for AsmClobberAbi {
2382 #[inline]
2383 fn kind() -> SyntaxKind
2384 where
2385 Self: Sized,
2386 {
2387 ASM_CLOBBER_ABI
2388 }
2389 #[inline]
2390 fn can_cast(kind: SyntaxKind) -> bool { kind == ASM_CLOBBER_ABI }
2391 #[inline]
2392 fn cast(syntax: SyntaxNode) -> Option<Self> {
2393 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
2394 }
2395 #[inline]
2396 fn syntax(&self) -> &SyntaxNode { &self.syntax }
2397}
2398impl hash::Hash for AsmClobberAbi {
2399 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
2400}
2401impl Eq for AsmClobberAbi {}
2402impl PartialEq for AsmClobberAbi {
2403 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
2404}
2405impl Clone for AsmClobberAbi {
2406 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
2407}
2408impl fmt::Debug for AsmClobberAbi {
2409 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
2410 f.debug_struct("AsmClobberAbi").field("syntax", &self.syntax).finish()
2411 }
2412}
2413impl AstNode for AsmConst {
2414 #[inline]
2415 fn kind() -> SyntaxKind
2416 where
2417 Self: Sized,
2418 {
2419 ASM_CONST
2420 }
2421 #[inline]
2422 fn can_cast(kind: SyntaxKind) -> bool { kind == ASM_CONST }
2423 #[inline]
2424 fn cast(syntax: SyntaxNode) -> Option<Self> {
2425 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
2426 }
2427 #[inline]
2428 fn syntax(&self) -> &SyntaxNode { &self.syntax }
2429}
2430impl hash::Hash for AsmConst {
2431 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
2432}
2433impl Eq for AsmConst {}
2434impl PartialEq for AsmConst {
2435 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
2436}
2437impl Clone for AsmConst {
2438 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
2439}
2440impl fmt::Debug for AsmConst {
2441 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
2442 f.debug_struct("AsmConst").field("syntax", &self.syntax).finish()
2443 }
2444}
2445impl AstNode for AsmDirSpec {
2446 #[inline]
2447 fn kind() -> SyntaxKind
2448 where
2449 Self: Sized,
2450 {
2451 ASM_DIR_SPEC
2452 }
2453 #[inline]
2454 fn can_cast(kind: SyntaxKind) -> bool { kind == ASM_DIR_SPEC }
2455 #[inline]
2456 fn cast(syntax: SyntaxNode) -> Option<Self> {
2457 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
2458 }
2459 #[inline]
2460 fn syntax(&self) -> &SyntaxNode { &self.syntax }
2461}
2462impl hash::Hash for AsmDirSpec {
2463 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
2464}
2465impl Eq for AsmDirSpec {}
2466impl PartialEq for AsmDirSpec {
2467 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
2468}
2469impl Clone for AsmDirSpec {
2470 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
2471}
2472impl fmt::Debug for AsmDirSpec {
2473 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
2474 f.debug_struct("AsmDirSpec").field("syntax", &self.syntax).finish()
2475 }
2476}
2477impl AstNode for AsmExpr {
2478 #[inline]
2479 fn kind() -> SyntaxKind
2480 where
2481 Self: Sized,
2482 {
2483 ASM_EXPR
2484 }
2485 #[inline]
2486 fn can_cast(kind: SyntaxKind) -> bool { kind == ASM_EXPR }
2487 #[inline]
2488 fn cast(syntax: SyntaxNode) -> Option<Self> {
2489 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
2490 }
2491 #[inline]
2492 fn syntax(&self) -> &SyntaxNode { &self.syntax }
2493}
2494impl hash::Hash for AsmExpr {
2495 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
2496}
2497impl Eq for AsmExpr {}
2498impl PartialEq for AsmExpr {
2499 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
2500}
2501impl Clone for AsmExpr {
2502 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
2503}
2504impl fmt::Debug for AsmExpr {
2505 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
2506 f.debug_struct("AsmExpr").field("syntax", &self.syntax).finish()
2507 }
2508}
2509impl AstNode for AsmLabel {
2510 #[inline]
2511 fn kind() -> SyntaxKind
2512 where
2513 Self: Sized,
2514 {
2515 ASM_LABEL
2516 }
2517 #[inline]
2518 fn can_cast(kind: SyntaxKind) -> bool { kind == ASM_LABEL }
2519 #[inline]
2520 fn cast(syntax: SyntaxNode) -> Option<Self> {
2521 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
2522 }
2523 #[inline]
2524 fn syntax(&self) -> &SyntaxNode { &self.syntax }
2525}
2526impl hash::Hash for AsmLabel {
2527 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
2528}
2529impl Eq for AsmLabel {}
2530impl PartialEq for AsmLabel {
2531 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
2532}
2533impl Clone for AsmLabel {
2534 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
2535}
2536impl fmt::Debug for AsmLabel {
2537 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
2538 f.debug_struct("AsmLabel").field("syntax", &self.syntax).finish()
2539 }
2540}
2541impl AstNode for AsmOperandExpr {
2542 #[inline]
2543 fn kind() -> SyntaxKind
2544 where
2545 Self: Sized,
2546 {
2547 ASM_OPERAND_EXPR
2548 }
2549 #[inline]
2550 fn can_cast(kind: SyntaxKind) -> bool { kind == ASM_OPERAND_EXPR }
2551 #[inline]
2552 fn cast(syntax: SyntaxNode) -> Option<Self> {
2553 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
2554 }
2555 #[inline]
2556 fn syntax(&self) -> &SyntaxNode { &self.syntax }
2557}
2558impl hash::Hash for AsmOperandExpr {
2559 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
2560}
2561impl Eq for AsmOperandExpr {}
2562impl PartialEq for AsmOperandExpr {
2563 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
2564}
2565impl Clone for AsmOperandExpr {
2566 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
2567}
2568impl fmt::Debug for AsmOperandExpr {
2569 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
2570 f.debug_struct("AsmOperandExpr").field("syntax", &self.syntax).finish()
2571 }
2572}
2573impl AstNode for AsmOperandNamed {
2574 #[inline]
2575 fn kind() -> SyntaxKind
2576 where
2577 Self: Sized,
2578 {
2579 ASM_OPERAND_NAMED
2580 }
2581 #[inline]
2582 fn can_cast(kind: SyntaxKind) -> bool { kind == ASM_OPERAND_NAMED }
2583 #[inline]
2584 fn cast(syntax: SyntaxNode) -> Option<Self> {
2585 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
2586 }
2587 #[inline]
2588 fn syntax(&self) -> &SyntaxNode { &self.syntax }
2589}
2590impl hash::Hash for AsmOperandNamed {
2591 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
2592}
2593impl Eq for AsmOperandNamed {}
2594impl PartialEq for AsmOperandNamed {
2595 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
2596}
2597impl Clone for AsmOperandNamed {
2598 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
2599}
2600impl fmt::Debug for AsmOperandNamed {
2601 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
2602 f.debug_struct("AsmOperandNamed").field("syntax", &self.syntax).finish()
2603 }
2604}
2605impl AstNode for AsmOption {
2606 #[inline]
2607 fn kind() -> SyntaxKind
2608 where
2609 Self: Sized,
2610 {
2611 ASM_OPTION
2612 }
2613 #[inline]
2614 fn can_cast(kind: SyntaxKind) -> bool { kind == ASM_OPTION }
2615 #[inline]
2616 fn cast(syntax: SyntaxNode) -> Option<Self> {
2617 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
2618 }
2619 #[inline]
2620 fn syntax(&self) -> &SyntaxNode { &self.syntax }
2621}
2622impl hash::Hash for AsmOption {
2623 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
2624}
2625impl Eq for AsmOption {}
2626impl PartialEq for AsmOption {
2627 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
2628}
2629impl Clone for AsmOption {
2630 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
2631}
2632impl fmt::Debug for AsmOption {
2633 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
2634 f.debug_struct("AsmOption").field("syntax", &self.syntax).finish()
2635 }
2636}
2637impl AstNode for AsmOptions {
2638 #[inline]
2639 fn kind() -> SyntaxKind
2640 where
2641 Self: Sized,
2642 {
2643 ASM_OPTIONS
2644 }
2645 #[inline]
2646 fn can_cast(kind: SyntaxKind) -> bool { kind == ASM_OPTIONS }
2647 #[inline]
2648 fn cast(syntax: SyntaxNode) -> Option<Self> {
2649 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
2650 }
2651 #[inline]
2652 fn syntax(&self) -> &SyntaxNode { &self.syntax }
2653}
2654impl hash::Hash for AsmOptions {
2655 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
2656}
2657impl Eq for AsmOptions {}
2658impl PartialEq for AsmOptions {
2659 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
2660}
2661impl Clone for AsmOptions {
2662 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
2663}
2664impl fmt::Debug for AsmOptions {
2665 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
2666 f.debug_struct("AsmOptions").field("syntax", &self.syntax).finish()
2667 }
2668}
2669impl AstNode for AsmRegOperand {
2670 #[inline]
2671 fn kind() -> SyntaxKind
2672 where
2673 Self: Sized,
2674 {
2675 ASM_REG_OPERAND
2676 }
2677 #[inline]
2678 fn can_cast(kind: SyntaxKind) -> bool { kind == ASM_REG_OPERAND }
2679 #[inline]
2680 fn cast(syntax: SyntaxNode) -> Option<Self> {
2681 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
2682 }
2683 #[inline]
2684 fn syntax(&self) -> &SyntaxNode { &self.syntax }
2685}
2686impl hash::Hash for AsmRegOperand {
2687 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
2688}
2689impl Eq for AsmRegOperand {}
2690impl PartialEq for AsmRegOperand {
2691 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
2692}
2693impl Clone for AsmRegOperand {
2694 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
2695}
2696impl fmt::Debug for AsmRegOperand {
2697 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
2698 f.debug_struct("AsmRegOperand").field("syntax", &self.syntax).finish()
2699 }
2700}
2701impl AstNode for AsmRegSpec {
2702 #[inline]
2703 fn kind() -> SyntaxKind
2704 where
2705 Self: Sized,
2706 {
2707 ASM_REG_SPEC
2708 }
2709 #[inline]
2710 fn can_cast(kind: SyntaxKind) -> bool { kind == ASM_REG_SPEC }
2711 #[inline]
2712 fn cast(syntax: SyntaxNode) -> Option<Self> {
2713 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
2714 }
2715 #[inline]
2716 fn syntax(&self) -> &SyntaxNode { &self.syntax }
2717}
2718impl hash::Hash for AsmRegSpec {
2719 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
2720}
2721impl Eq for AsmRegSpec {}
2722impl PartialEq for AsmRegSpec {
2723 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
2724}
2725impl Clone for AsmRegSpec {
2726 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
2727}
2728impl fmt::Debug for AsmRegSpec {
2729 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
2730 f.debug_struct("AsmRegSpec").field("syntax", &self.syntax).finish()
2731 }
2732}
2733impl AstNode for AsmSym {
2734 #[inline]
2735 fn kind() -> SyntaxKind
2736 where
2737 Self: Sized,
2738 {
2739 ASM_SYM
2740 }
2741 #[inline]
2742 fn can_cast(kind: SyntaxKind) -> bool { kind == ASM_SYM }
2743 #[inline]
2744 fn cast(syntax: SyntaxNode) -> Option<Self> {
2745 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
2746 }
2747 #[inline]
2748 fn syntax(&self) -> &SyntaxNode { &self.syntax }
2749}
2750impl hash::Hash for AsmSym {
2751 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
2752}
2753impl Eq for AsmSym {}
2754impl PartialEq for AsmSym {
2755 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
2756}
2757impl Clone for AsmSym {
2758 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
2759}
2760impl fmt::Debug for AsmSym {
2761 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
2762 f.debug_struct("AsmSym").field("syntax", &self.syntax).finish()
2763 }
2764}
2765impl AstNode for AssocItemList {
2766 #[inline]
2767 fn kind() -> SyntaxKind
2768 where
2769 Self: Sized,
2770 {
2771 ASSOC_ITEM_LIST
2772 }
2773 #[inline]
2774 fn can_cast(kind: SyntaxKind) -> bool { kind == ASSOC_ITEM_LIST }
2775 #[inline]
2776 fn cast(syntax: SyntaxNode) -> Option<Self> {
2777 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
2778 }
2779 #[inline]
2780 fn syntax(&self) -> &SyntaxNode { &self.syntax }
2781}
2782impl hash::Hash for AssocItemList {
2783 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
2784}
2785impl Eq for AssocItemList {}
2786impl PartialEq for AssocItemList {
2787 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
2788}
2789impl Clone for AssocItemList {
2790 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
2791}
2792impl fmt::Debug for AssocItemList {
2793 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
2794 f.debug_struct("AssocItemList").field("syntax", &self.syntax).finish()
2795 }
2796}
2797impl AstNode for AssocTypeArg {
2798 #[inline]
2799 fn kind() -> SyntaxKind
2800 where
2801 Self: Sized,
2802 {
2803 ASSOC_TYPE_ARG
2804 }
2805 #[inline]
2806 fn can_cast(kind: SyntaxKind) -> bool { kind == ASSOC_TYPE_ARG }
2807 #[inline]
2808 fn cast(syntax: SyntaxNode) -> Option<Self> {
2809 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
2810 }
2811 #[inline]
2812 fn syntax(&self) -> &SyntaxNode { &self.syntax }
2813}
2814impl hash::Hash for AssocTypeArg {
2815 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
2816}
2817impl Eq for AssocTypeArg {}
2818impl PartialEq for AssocTypeArg {
2819 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
2820}
2821impl Clone for AssocTypeArg {
2822 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
2823}
2824impl fmt::Debug for AssocTypeArg {
2825 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
2826 f.debug_struct("AssocTypeArg").field("syntax", &self.syntax).finish()
2827 }
2828}
2829impl AstNode for Attr {
2830 #[inline]
2831 fn kind() -> SyntaxKind
2832 where
2833 Self: Sized,
2834 {
2835 ATTR
2836 }
2837 #[inline]
2838 fn can_cast(kind: SyntaxKind) -> bool { kind == ATTR }
2839 #[inline]
2840 fn cast(syntax: SyntaxNode) -> Option<Self> {
2841 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
2842 }
2843 #[inline]
2844 fn syntax(&self) -> &SyntaxNode { &self.syntax }
2845}
2846impl hash::Hash for Attr {
2847 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
2848}
2849impl Eq for Attr {}
2850impl PartialEq for Attr {
2851 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
2852}
2853impl Clone for Attr {
2854 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
2855}
2856impl fmt::Debug for Attr {
2857 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
2858 f.debug_struct("Attr").field("syntax", &self.syntax).finish()
2859 }
2860}
2861impl AstNode for AwaitExpr {
2862 #[inline]
2863 fn kind() -> SyntaxKind
2864 where
2865 Self: Sized,
2866 {
2867 AWAIT_EXPR
2868 }
2869 #[inline]
2870 fn can_cast(kind: SyntaxKind) -> bool { kind == AWAIT_EXPR }
2871 #[inline]
2872 fn cast(syntax: SyntaxNode) -> Option<Self> {
2873 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
2874 }
2875 #[inline]
2876 fn syntax(&self) -> &SyntaxNode { &self.syntax }
2877}
2878impl hash::Hash for AwaitExpr {
2879 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
2880}
2881impl Eq for AwaitExpr {}
2882impl PartialEq for AwaitExpr {
2883 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
2884}
2885impl Clone for AwaitExpr {
2886 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
2887}
2888impl fmt::Debug for AwaitExpr {
2889 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
2890 f.debug_struct("AwaitExpr").field("syntax", &self.syntax).finish()
2891 }
2892}
2893impl AstNode for BecomeExpr {
2894 #[inline]
2895 fn kind() -> SyntaxKind
2896 where
2897 Self: Sized,
2898 {
2899 BECOME_EXPR
2900 }
2901 #[inline]
2902 fn can_cast(kind: SyntaxKind) -> bool { kind == BECOME_EXPR }
2903 #[inline]
2904 fn cast(syntax: SyntaxNode) -> Option<Self> {
2905 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
2906 }
2907 #[inline]
2908 fn syntax(&self) -> &SyntaxNode { &self.syntax }
2909}
2910impl hash::Hash for BecomeExpr {
2911 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
2912}
2913impl Eq for BecomeExpr {}
2914impl PartialEq for BecomeExpr {
2915 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
2916}
2917impl Clone for BecomeExpr {
2918 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
2919}
2920impl fmt::Debug for BecomeExpr {
2921 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
2922 f.debug_struct("BecomeExpr").field("syntax", &self.syntax).finish()
2923 }
2924}
2925impl AstNode for BinExpr {
2926 #[inline]
2927 fn kind() -> SyntaxKind
2928 where
2929 Self: Sized,
2930 {
2931 BIN_EXPR
2932 }
2933 #[inline]
2934 fn can_cast(kind: SyntaxKind) -> bool { kind == BIN_EXPR }
2935 #[inline]
2936 fn cast(syntax: SyntaxNode) -> Option<Self> {
2937 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
2938 }
2939 #[inline]
2940 fn syntax(&self) -> &SyntaxNode { &self.syntax }
2941}
2942impl hash::Hash for BinExpr {
2943 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
2944}
2945impl Eq for BinExpr {}
2946impl PartialEq for BinExpr {
2947 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
2948}
2949impl Clone for BinExpr {
2950 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
2951}
2952impl fmt::Debug for BinExpr {
2953 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
2954 f.debug_struct("BinExpr").field("syntax", &self.syntax).finish()
2955 }
2956}
2957impl AstNode for BlockExpr {
2958 #[inline]
2959 fn kind() -> SyntaxKind
2960 where
2961 Self: Sized,
2962 {
2963 BLOCK_EXPR
2964 }
2965 #[inline]
2966 fn can_cast(kind: SyntaxKind) -> bool { kind == BLOCK_EXPR }
2967 #[inline]
2968 fn cast(syntax: SyntaxNode) -> Option<Self> {
2969 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
2970 }
2971 #[inline]
2972 fn syntax(&self) -> &SyntaxNode { &self.syntax }
2973}
2974impl hash::Hash for BlockExpr {
2975 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
2976}
2977impl Eq for BlockExpr {}
2978impl PartialEq for BlockExpr {
2979 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
2980}
2981impl Clone for BlockExpr {
2982 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
2983}
2984impl fmt::Debug for BlockExpr {
2985 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
2986 f.debug_struct("BlockExpr").field("syntax", &self.syntax).finish()
2987 }
2988}
2989impl AstNode for BoxPat {
2990 #[inline]
2991 fn kind() -> SyntaxKind
2992 where
2993 Self: Sized,
2994 {
2995 BOX_PAT
2996 }
2997 #[inline]
2998 fn can_cast(kind: SyntaxKind) -> bool { kind == BOX_PAT }
2999 #[inline]
3000 fn cast(syntax: SyntaxNode) -> Option<Self> {
3001 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
3002 }
3003 #[inline]
3004 fn syntax(&self) -> &SyntaxNode { &self.syntax }
3005}
3006impl hash::Hash for BoxPat {
3007 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
3008}
3009impl Eq for BoxPat {}
3010impl PartialEq for BoxPat {
3011 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
3012}
3013impl Clone for BoxPat {
3014 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
3015}
3016impl fmt::Debug for BoxPat {
3017 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
3018 f.debug_struct("BoxPat").field("syntax", &self.syntax).finish()
3019 }
3020}
3021impl AstNode for BreakExpr {
3022 #[inline]
3023 fn kind() -> SyntaxKind
3024 where
3025 Self: Sized,
3026 {
3027 BREAK_EXPR
3028 }
3029 #[inline]
3030 fn can_cast(kind: SyntaxKind) -> bool { kind == BREAK_EXPR }
3031 #[inline]
3032 fn cast(syntax: SyntaxNode) -> Option<Self> {
3033 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
3034 }
3035 #[inline]
3036 fn syntax(&self) -> &SyntaxNode { &self.syntax }
3037}
3038impl hash::Hash for BreakExpr {
3039 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
3040}
3041impl Eq for BreakExpr {}
3042impl PartialEq for BreakExpr {
3043 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
3044}
3045impl Clone for BreakExpr {
3046 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
3047}
3048impl fmt::Debug for BreakExpr {
3049 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
3050 f.debug_struct("BreakExpr").field("syntax", &self.syntax).finish()
3051 }
3052}
3053impl AstNode for CallExpr {
3054 #[inline]
3055 fn kind() -> SyntaxKind
3056 where
3057 Self: Sized,
3058 {
3059 CALL_EXPR
3060 }
3061 #[inline]
3062 fn can_cast(kind: SyntaxKind) -> bool { kind == CALL_EXPR }
3063 #[inline]
3064 fn cast(syntax: SyntaxNode) -> Option<Self> {
3065 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
3066 }
3067 #[inline]
3068 fn syntax(&self) -> &SyntaxNode { &self.syntax }
3069}
3070impl hash::Hash for CallExpr {
3071 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
3072}
3073impl Eq for CallExpr {}
3074impl PartialEq for CallExpr {
3075 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
3076}
3077impl Clone for CallExpr {
3078 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
3079}
3080impl fmt::Debug for CallExpr {
3081 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
3082 f.debug_struct("CallExpr").field("syntax", &self.syntax).finish()
3083 }
3084}
3085impl AstNode for CastExpr {
3086 #[inline]
3087 fn kind() -> SyntaxKind
3088 where
3089 Self: Sized,
3090 {
3091 CAST_EXPR
3092 }
3093 #[inline]
3094 fn can_cast(kind: SyntaxKind) -> bool { kind == CAST_EXPR }
3095 #[inline]
3096 fn cast(syntax: SyntaxNode) -> Option<Self> {
3097 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
3098 }
3099 #[inline]
3100 fn syntax(&self) -> &SyntaxNode { &self.syntax }
3101}
3102impl hash::Hash for CastExpr {
3103 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
3104}
3105impl Eq for CastExpr {}
3106impl PartialEq for CastExpr {
3107 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
3108}
3109impl Clone for CastExpr {
3110 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
3111}
3112impl fmt::Debug for CastExpr {
3113 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
3114 f.debug_struct("CastExpr").field("syntax", &self.syntax).finish()
3115 }
3116}
3117impl AstNode for ClosureExpr {
3118 #[inline]
3119 fn kind() -> SyntaxKind
3120 where
3121 Self: Sized,
3122 {
3123 CLOSURE_EXPR
3124 }
3125 #[inline]
3126 fn can_cast(kind: SyntaxKind) -> bool { kind == CLOSURE_EXPR }
3127 #[inline]
3128 fn cast(syntax: SyntaxNode) -> Option<Self> {
3129 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
3130 }
3131 #[inline]
3132 fn syntax(&self) -> &SyntaxNode { &self.syntax }
3133}
3134impl hash::Hash for ClosureExpr {
3135 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
3136}
3137impl Eq for ClosureExpr {}
3138impl PartialEq for ClosureExpr {
3139 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
3140}
3141impl Clone for ClosureExpr {
3142 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
3143}
3144impl fmt::Debug for ClosureExpr {
3145 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
3146 f.debug_struct("ClosureExpr").field("syntax", &self.syntax).finish()
3147 }
3148}
3149impl AstNode for Const {
3150 #[inline]
3151 fn kind() -> SyntaxKind
3152 where
3153 Self: Sized,
3154 {
3155 CONST
3156 }
3157 #[inline]
3158 fn can_cast(kind: SyntaxKind) -> bool { kind == CONST }
3159 #[inline]
3160 fn cast(syntax: SyntaxNode) -> Option<Self> {
3161 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
3162 }
3163 #[inline]
3164 fn syntax(&self) -> &SyntaxNode { &self.syntax }
3165}
3166impl hash::Hash for Const {
3167 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
3168}
3169impl Eq for Const {}
3170impl PartialEq for Const {
3171 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
3172}
3173impl Clone for Const {
3174 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
3175}
3176impl fmt::Debug for Const {
3177 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
3178 f.debug_struct("Const").field("syntax", &self.syntax).finish()
3179 }
3180}
3181impl AstNode for ConstArg {
3182 #[inline]
3183 fn kind() -> SyntaxKind
3184 where
3185 Self: Sized,
3186 {
3187 CONST_ARG
3188 }
3189 #[inline]
3190 fn can_cast(kind: SyntaxKind) -> bool { kind == CONST_ARG }
3191 #[inline]
3192 fn cast(syntax: SyntaxNode) -> Option<Self> {
3193 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
3194 }
3195 #[inline]
3196 fn syntax(&self) -> &SyntaxNode { &self.syntax }
3197}
3198impl hash::Hash for ConstArg {
3199 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
3200}
3201impl Eq for ConstArg {}
3202impl PartialEq for ConstArg {
3203 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
3204}
3205impl Clone for ConstArg {
3206 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
3207}
3208impl fmt::Debug for ConstArg {
3209 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
3210 f.debug_struct("ConstArg").field("syntax", &self.syntax).finish()
3211 }
3212}
3213impl AstNode for ConstBlockPat {
3214 #[inline]
3215 fn kind() -> SyntaxKind
3216 where
3217 Self: Sized,
3218 {
3219 CONST_BLOCK_PAT
3220 }
3221 #[inline]
3222 fn can_cast(kind: SyntaxKind) -> bool { kind == CONST_BLOCK_PAT }
3223 #[inline]
3224 fn cast(syntax: SyntaxNode) -> Option<Self> {
3225 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
3226 }
3227 #[inline]
3228 fn syntax(&self) -> &SyntaxNode { &self.syntax }
3229}
3230impl hash::Hash for ConstBlockPat {
3231 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
3232}
3233impl Eq for ConstBlockPat {}
3234impl PartialEq for ConstBlockPat {
3235 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
3236}
3237impl Clone for ConstBlockPat {
3238 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
3239}
3240impl fmt::Debug for ConstBlockPat {
3241 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
3242 f.debug_struct("ConstBlockPat").field("syntax", &self.syntax).finish()
3243 }
3244}
3245impl AstNode for ConstParam {
3246 #[inline]
3247 fn kind() -> SyntaxKind
3248 where
3249 Self: Sized,
3250 {
3251 CONST_PARAM
3252 }
3253 #[inline]
3254 fn can_cast(kind: SyntaxKind) -> bool { kind == CONST_PARAM }
3255 #[inline]
3256 fn cast(syntax: SyntaxNode) -> Option<Self> {
3257 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
3258 }
3259 #[inline]
3260 fn syntax(&self) -> &SyntaxNode { &self.syntax }
3261}
3262impl hash::Hash for ConstParam {
3263 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
3264}
3265impl Eq for ConstParam {}
3266impl PartialEq for ConstParam {
3267 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
3268}
3269impl Clone for ConstParam {
3270 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
3271}
3272impl fmt::Debug for ConstParam {
3273 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
3274 f.debug_struct("ConstParam").field("syntax", &self.syntax).finish()
3275 }
3276}
3277impl AstNode for ContinueExpr {
3278 #[inline]
3279 fn kind() -> SyntaxKind
3280 where
3281 Self: Sized,
3282 {
3283 CONTINUE_EXPR
3284 }
3285 #[inline]
3286 fn can_cast(kind: SyntaxKind) -> bool { kind == CONTINUE_EXPR }
3287 #[inline]
3288 fn cast(syntax: SyntaxNode) -> Option<Self> {
3289 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
3290 }
3291 #[inline]
3292 fn syntax(&self) -> &SyntaxNode { &self.syntax }
3293}
3294impl hash::Hash for ContinueExpr {
3295 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
3296}
3297impl Eq for ContinueExpr {}
3298impl PartialEq for ContinueExpr {
3299 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
3300}
3301impl Clone for ContinueExpr {
3302 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
3303}
3304impl fmt::Debug for ContinueExpr {
3305 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
3306 f.debug_struct("ContinueExpr").field("syntax", &self.syntax).finish()
3307 }
3308}
3309impl AstNode for DynTraitType {
3310 #[inline]
3311 fn kind() -> SyntaxKind
3312 where
3313 Self: Sized,
3314 {
3315 DYN_TRAIT_TYPE
3316 }
3317 #[inline]
3318 fn can_cast(kind: SyntaxKind) -> bool { kind == DYN_TRAIT_TYPE }
3319 #[inline]
3320 fn cast(syntax: SyntaxNode) -> Option<Self> {
3321 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
3322 }
3323 #[inline]
3324 fn syntax(&self) -> &SyntaxNode { &self.syntax }
3325}
3326impl hash::Hash for DynTraitType {
3327 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
3328}
3329impl Eq for DynTraitType {}
3330impl PartialEq for DynTraitType {
3331 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
3332}
3333impl Clone for DynTraitType {
3334 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
3335}
3336impl fmt::Debug for DynTraitType {
3337 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
3338 f.debug_struct("DynTraitType").field("syntax", &self.syntax).finish()
3339 }
3340}
3341impl AstNode for Enum {
3342 #[inline]
3343 fn kind() -> SyntaxKind
3344 where
3345 Self: Sized,
3346 {
3347 ENUM
3348 }
3349 #[inline]
3350 fn can_cast(kind: SyntaxKind) -> bool { kind == ENUM }
3351 #[inline]
3352 fn cast(syntax: SyntaxNode) -> Option<Self> {
3353 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
3354 }
3355 #[inline]
3356 fn syntax(&self) -> &SyntaxNode { &self.syntax }
3357}
3358impl hash::Hash for Enum {
3359 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
3360}
3361impl Eq for Enum {}
3362impl PartialEq for Enum {
3363 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
3364}
3365impl Clone for Enum {
3366 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
3367}
3368impl fmt::Debug for Enum {
3369 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
3370 f.debug_struct("Enum").field("syntax", &self.syntax).finish()
3371 }
3372}
3373impl AstNode for ExprStmt {
3374 #[inline]
3375 fn kind() -> SyntaxKind
3376 where
3377 Self: Sized,
3378 {
3379 EXPR_STMT
3380 }
3381 #[inline]
3382 fn can_cast(kind: SyntaxKind) -> bool { kind == EXPR_STMT }
3383 #[inline]
3384 fn cast(syntax: SyntaxNode) -> Option<Self> {
3385 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
3386 }
3387 #[inline]
3388 fn syntax(&self) -> &SyntaxNode { &self.syntax }
3389}
3390impl hash::Hash for ExprStmt {
3391 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
3392}
3393impl Eq for ExprStmt {}
3394impl PartialEq for ExprStmt {
3395 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
3396}
3397impl Clone for ExprStmt {
3398 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
3399}
3400impl fmt::Debug for ExprStmt {
3401 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
3402 f.debug_struct("ExprStmt").field("syntax", &self.syntax).finish()
3403 }
3404}
3405impl AstNode for ExternBlock {
3406 #[inline]
3407 fn kind() -> SyntaxKind
3408 where
3409 Self: Sized,
3410 {
3411 EXTERN_BLOCK
3412 }
3413 #[inline]
3414 fn can_cast(kind: SyntaxKind) -> bool { kind == EXTERN_BLOCK }
3415 #[inline]
3416 fn cast(syntax: SyntaxNode) -> Option<Self> {
3417 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
3418 }
3419 #[inline]
3420 fn syntax(&self) -> &SyntaxNode { &self.syntax }
3421}
3422impl hash::Hash for ExternBlock {
3423 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
3424}
3425impl Eq for ExternBlock {}
3426impl PartialEq for ExternBlock {
3427 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
3428}
3429impl Clone for ExternBlock {
3430 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
3431}
3432impl fmt::Debug for ExternBlock {
3433 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
3434 f.debug_struct("ExternBlock").field("syntax", &self.syntax).finish()
3435 }
3436}
3437impl AstNode for ExternCrate {
3438 #[inline]
3439 fn kind() -> SyntaxKind
3440 where
3441 Self: Sized,
3442 {
3443 EXTERN_CRATE
3444 }
3445 #[inline]
3446 fn can_cast(kind: SyntaxKind) -> bool { kind == EXTERN_CRATE }
3447 #[inline]
3448 fn cast(syntax: SyntaxNode) -> Option<Self> {
3449 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
3450 }
3451 #[inline]
3452 fn syntax(&self) -> &SyntaxNode { &self.syntax }
3453}
3454impl hash::Hash for ExternCrate {
3455 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
3456}
3457impl Eq for ExternCrate {}
3458impl PartialEq for ExternCrate {
3459 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
3460}
3461impl Clone for ExternCrate {
3462 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
3463}
3464impl fmt::Debug for ExternCrate {
3465 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
3466 f.debug_struct("ExternCrate").field("syntax", &self.syntax).finish()
3467 }
3468}
3469impl AstNode for ExternItemList {
3470 #[inline]
3471 fn kind() -> SyntaxKind
3472 where
3473 Self: Sized,
3474 {
3475 EXTERN_ITEM_LIST
3476 }
3477 #[inline]
3478 fn can_cast(kind: SyntaxKind) -> bool { kind == EXTERN_ITEM_LIST }
3479 #[inline]
3480 fn cast(syntax: SyntaxNode) -> Option<Self> {
3481 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
3482 }
3483 #[inline]
3484 fn syntax(&self) -> &SyntaxNode { &self.syntax }
3485}
3486impl hash::Hash for ExternItemList {
3487 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
3488}
3489impl Eq for ExternItemList {}
3490impl PartialEq for ExternItemList {
3491 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
3492}
3493impl Clone for ExternItemList {
3494 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
3495}
3496impl fmt::Debug for ExternItemList {
3497 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
3498 f.debug_struct("ExternItemList").field("syntax", &self.syntax).finish()
3499 }
3500}
3501impl AstNode for FieldExpr {
3502 #[inline]
3503 fn kind() -> SyntaxKind
3504 where
3505 Self: Sized,
3506 {
3507 FIELD_EXPR
3508 }
3509 #[inline]
3510 fn can_cast(kind: SyntaxKind) -> bool { kind == FIELD_EXPR }
3511 #[inline]
3512 fn cast(syntax: SyntaxNode) -> Option<Self> {
3513 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
3514 }
3515 #[inline]
3516 fn syntax(&self) -> &SyntaxNode { &self.syntax }
3517}
3518impl hash::Hash for FieldExpr {
3519 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
3520}
3521impl Eq for FieldExpr {}
3522impl PartialEq for FieldExpr {
3523 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
3524}
3525impl Clone for FieldExpr {
3526 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
3527}
3528impl fmt::Debug for FieldExpr {
3529 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
3530 f.debug_struct("FieldExpr").field("syntax", &self.syntax).finish()
3531 }
3532}
3533impl AstNode for Fn {
3534 #[inline]
3535 fn kind() -> SyntaxKind
3536 where
3537 Self: Sized,
3538 {
3539 FN
3540 }
3541 #[inline]
3542 fn can_cast(kind: SyntaxKind) -> bool { kind == FN }
3543 #[inline]
3544 fn cast(syntax: SyntaxNode) -> Option<Self> {
3545 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
3546 }
3547 #[inline]
3548 fn syntax(&self) -> &SyntaxNode { &self.syntax }
3549}
3550impl hash::Hash for Fn {
3551 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
3552}
3553impl Eq for Fn {}
3554impl PartialEq for Fn {
3555 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
3556}
3557impl Clone for Fn {
3558 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
3559}
3560impl fmt::Debug for Fn {
3561 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
3562 f.debug_struct("Fn").field("syntax", &self.syntax).finish()
3563 }
3564}
3565impl AstNode for FnPtrType {
3566 #[inline]
3567 fn kind() -> SyntaxKind
3568 where
3569 Self: Sized,
3570 {
3571 FN_PTR_TYPE
3572 }
3573 #[inline]
3574 fn can_cast(kind: SyntaxKind) -> bool { kind == FN_PTR_TYPE }
3575 #[inline]
3576 fn cast(syntax: SyntaxNode) -> Option<Self> {
3577 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
3578 }
3579 #[inline]
3580 fn syntax(&self) -> &SyntaxNode { &self.syntax }
3581}
3582impl hash::Hash for FnPtrType {
3583 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
3584}
3585impl Eq for FnPtrType {}
3586impl PartialEq for FnPtrType {
3587 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
3588}
3589impl Clone for FnPtrType {
3590 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
3591}
3592impl fmt::Debug for FnPtrType {
3593 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
3594 f.debug_struct("FnPtrType").field("syntax", &self.syntax).finish()
3595 }
3596}
3597impl AstNode for ForBinder {
3598 #[inline]
3599 fn kind() -> SyntaxKind
3600 where
3601 Self: Sized,
3602 {
3603 FOR_BINDER
3604 }
3605 #[inline]
3606 fn can_cast(kind: SyntaxKind) -> bool { kind == FOR_BINDER }
3607 #[inline]
3608 fn cast(syntax: SyntaxNode) -> Option<Self> {
3609 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
3610 }
3611 #[inline]
3612 fn syntax(&self) -> &SyntaxNode { &self.syntax }
3613}
3614impl hash::Hash for ForBinder {
3615 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
3616}
3617impl Eq for ForBinder {}
3618impl PartialEq for ForBinder {
3619 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
3620}
3621impl Clone for ForBinder {
3622 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
3623}
3624impl fmt::Debug for ForBinder {
3625 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
3626 f.debug_struct("ForBinder").field("syntax", &self.syntax).finish()
3627 }
3628}
3629impl AstNode for ForExpr {
3630 #[inline]
3631 fn kind() -> SyntaxKind
3632 where
3633 Self: Sized,
3634 {
3635 FOR_EXPR
3636 }
3637 #[inline]
3638 fn can_cast(kind: SyntaxKind) -> bool { kind == FOR_EXPR }
3639 #[inline]
3640 fn cast(syntax: SyntaxNode) -> Option<Self> {
3641 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
3642 }
3643 #[inline]
3644 fn syntax(&self) -> &SyntaxNode { &self.syntax }
3645}
3646impl hash::Hash for ForExpr {
3647 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
3648}
3649impl Eq for ForExpr {}
3650impl PartialEq for ForExpr {
3651 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
3652}
3653impl Clone for ForExpr {
3654 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
3655}
3656impl fmt::Debug for ForExpr {
3657 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
3658 f.debug_struct("ForExpr").field("syntax", &self.syntax).finish()
3659 }
3660}
3661impl AstNode for ForType {
3662 #[inline]
3663 fn kind() -> SyntaxKind
3664 where
3665 Self: Sized,
3666 {
3667 FOR_TYPE
3668 }
3669 #[inline]
3670 fn can_cast(kind: SyntaxKind) -> bool { kind == FOR_TYPE }
3671 #[inline]
3672 fn cast(syntax: SyntaxNode) -> Option<Self> {
3673 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
3674 }
3675 #[inline]
3676 fn syntax(&self) -> &SyntaxNode { &self.syntax }
3677}
3678impl hash::Hash for ForType {
3679 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
3680}
3681impl Eq for ForType {}
3682impl PartialEq for ForType {
3683 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
3684}
3685impl Clone for ForType {
3686 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
3687}
3688impl fmt::Debug for ForType {
3689 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
3690 f.debug_struct("ForType").field("syntax", &self.syntax).finish()
3691 }
3692}
3693impl AstNode for FormatArgsArg {
3694 #[inline]
3695 fn kind() -> SyntaxKind
3696 where
3697 Self: Sized,
3698 {
3699 FORMAT_ARGS_ARG
3700 }
3701 #[inline]
3702 fn can_cast(kind: SyntaxKind) -> bool { kind == FORMAT_ARGS_ARG }
3703 #[inline]
3704 fn cast(syntax: SyntaxNode) -> Option<Self> {
3705 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
3706 }
3707 #[inline]
3708 fn syntax(&self) -> &SyntaxNode { &self.syntax }
3709}
3710impl hash::Hash for FormatArgsArg {
3711 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
3712}
3713impl Eq for FormatArgsArg {}
3714impl PartialEq for FormatArgsArg {
3715 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
3716}
3717impl Clone for FormatArgsArg {
3718 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
3719}
3720impl fmt::Debug for FormatArgsArg {
3721 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
3722 f.debug_struct("FormatArgsArg").field("syntax", &self.syntax).finish()
3723 }
3724}
3725impl AstNode for FormatArgsExpr {
3726 #[inline]
3727 fn kind() -> SyntaxKind
3728 where
3729 Self: Sized,
3730 {
3731 FORMAT_ARGS_EXPR
3732 }
3733 #[inline]
3734 fn can_cast(kind: SyntaxKind) -> bool { kind == FORMAT_ARGS_EXPR }
3735 #[inline]
3736 fn cast(syntax: SyntaxNode) -> Option<Self> {
3737 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
3738 }
3739 #[inline]
3740 fn syntax(&self) -> &SyntaxNode { &self.syntax }
3741}
3742impl hash::Hash for FormatArgsExpr {
3743 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
3744}
3745impl Eq for FormatArgsExpr {}
3746impl PartialEq for FormatArgsExpr {
3747 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
3748}
3749impl Clone for FormatArgsExpr {
3750 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
3751}
3752impl fmt::Debug for FormatArgsExpr {
3753 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
3754 f.debug_struct("FormatArgsExpr").field("syntax", &self.syntax).finish()
3755 }
3756}
3757impl AstNode for GenericArgList {
3758 #[inline]
3759 fn kind() -> SyntaxKind
3760 where
3761 Self: Sized,
3762 {
3763 GENERIC_ARG_LIST
3764 }
3765 #[inline]
3766 fn can_cast(kind: SyntaxKind) -> bool { kind == GENERIC_ARG_LIST }
3767 #[inline]
3768 fn cast(syntax: SyntaxNode) -> Option<Self> {
3769 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
3770 }
3771 #[inline]
3772 fn syntax(&self) -> &SyntaxNode { &self.syntax }
3773}
3774impl hash::Hash for GenericArgList {
3775 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
3776}
3777impl Eq for GenericArgList {}
3778impl PartialEq for GenericArgList {
3779 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
3780}
3781impl Clone for GenericArgList {
3782 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
3783}
3784impl fmt::Debug for GenericArgList {
3785 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
3786 f.debug_struct("GenericArgList").field("syntax", &self.syntax).finish()
3787 }
3788}
3789impl AstNode for GenericParamList {
3790 #[inline]
3791 fn kind() -> SyntaxKind
3792 where
3793 Self: Sized,
3794 {
3795 GENERIC_PARAM_LIST
3796 }
3797 #[inline]
3798 fn can_cast(kind: SyntaxKind) -> bool { kind == GENERIC_PARAM_LIST }
3799 #[inline]
3800 fn cast(syntax: SyntaxNode) -> Option<Self> {
3801 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
3802 }
3803 #[inline]
3804 fn syntax(&self) -> &SyntaxNode { &self.syntax }
3805}
3806impl hash::Hash for GenericParamList {
3807 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
3808}
3809impl Eq for GenericParamList {}
3810impl PartialEq for GenericParamList {
3811 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
3812}
3813impl Clone for GenericParamList {
3814 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
3815}
3816impl fmt::Debug for GenericParamList {
3817 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
3818 f.debug_struct("GenericParamList").field("syntax", &self.syntax).finish()
3819 }
3820}
3821impl AstNode for IdentPat {
3822 #[inline]
3823 fn kind() -> SyntaxKind
3824 where
3825 Self: Sized,
3826 {
3827 IDENT_PAT
3828 }
3829 #[inline]
3830 fn can_cast(kind: SyntaxKind) -> bool { kind == IDENT_PAT }
3831 #[inline]
3832 fn cast(syntax: SyntaxNode) -> Option<Self> {
3833 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
3834 }
3835 #[inline]
3836 fn syntax(&self) -> &SyntaxNode { &self.syntax }
3837}
3838impl hash::Hash for IdentPat {
3839 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
3840}
3841impl Eq for IdentPat {}
3842impl PartialEq for IdentPat {
3843 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
3844}
3845impl Clone for IdentPat {
3846 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
3847}
3848impl fmt::Debug for IdentPat {
3849 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
3850 f.debug_struct("IdentPat").field("syntax", &self.syntax).finish()
3851 }
3852}
3853impl AstNode for IfExpr {
3854 #[inline]
3855 fn kind() -> SyntaxKind
3856 where
3857 Self: Sized,
3858 {
3859 IF_EXPR
3860 }
3861 #[inline]
3862 fn can_cast(kind: SyntaxKind) -> bool { kind == IF_EXPR }
3863 #[inline]
3864 fn cast(syntax: SyntaxNode) -> Option<Self> {
3865 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
3866 }
3867 #[inline]
3868 fn syntax(&self) -> &SyntaxNode { &self.syntax }
3869}
3870impl hash::Hash for IfExpr {
3871 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
3872}
3873impl Eq for IfExpr {}
3874impl PartialEq for IfExpr {
3875 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
3876}
3877impl Clone for IfExpr {
3878 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
3879}
3880impl fmt::Debug for IfExpr {
3881 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
3882 f.debug_struct("IfExpr").field("syntax", &self.syntax).finish()
3883 }
3884}
3885impl AstNode for Impl {
3886 #[inline]
3887 fn kind() -> SyntaxKind
3888 where
3889 Self: Sized,
3890 {
3891 IMPL
3892 }
3893 #[inline]
3894 fn can_cast(kind: SyntaxKind) -> bool { kind == IMPL }
3895 #[inline]
3896 fn cast(syntax: SyntaxNode) -> Option<Self> {
3897 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
3898 }
3899 #[inline]
3900 fn syntax(&self) -> &SyntaxNode { &self.syntax }
3901}
3902impl hash::Hash for Impl {
3903 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
3904}
3905impl Eq for Impl {}
3906impl PartialEq for Impl {
3907 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
3908}
3909impl Clone for Impl {
3910 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
3911}
3912impl fmt::Debug for Impl {
3913 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
3914 f.debug_struct("Impl").field("syntax", &self.syntax).finish()
3915 }
3916}
3917impl AstNode for ImplTraitType {
3918 #[inline]
3919 fn kind() -> SyntaxKind
3920 where
3921 Self: Sized,
3922 {
3923 IMPL_TRAIT_TYPE
3924 }
3925 #[inline]
3926 fn can_cast(kind: SyntaxKind) -> bool { kind == IMPL_TRAIT_TYPE }
3927 #[inline]
3928 fn cast(syntax: SyntaxNode) -> Option<Self> {
3929 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
3930 }
3931 #[inline]
3932 fn syntax(&self) -> &SyntaxNode { &self.syntax }
3933}
3934impl hash::Hash for ImplTraitType {
3935 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
3936}
3937impl Eq for ImplTraitType {}
3938impl PartialEq for ImplTraitType {
3939 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
3940}
3941impl Clone for ImplTraitType {
3942 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
3943}
3944impl fmt::Debug for ImplTraitType {
3945 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
3946 f.debug_struct("ImplTraitType").field("syntax", &self.syntax).finish()
3947 }
3948}
3949impl AstNode for IndexExpr {
3950 #[inline]
3951 fn kind() -> SyntaxKind
3952 where
3953 Self: Sized,
3954 {
3955 INDEX_EXPR
3956 }
3957 #[inline]
3958 fn can_cast(kind: SyntaxKind) -> bool { kind == INDEX_EXPR }
3959 #[inline]
3960 fn cast(syntax: SyntaxNode) -> Option<Self> {
3961 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
3962 }
3963 #[inline]
3964 fn syntax(&self) -> &SyntaxNode { &self.syntax }
3965}
3966impl hash::Hash for IndexExpr {
3967 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
3968}
3969impl Eq for IndexExpr {}
3970impl PartialEq for IndexExpr {
3971 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
3972}
3973impl Clone for IndexExpr {
3974 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
3975}
3976impl fmt::Debug for IndexExpr {
3977 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
3978 f.debug_struct("IndexExpr").field("syntax", &self.syntax).finish()
3979 }
3980}
3981impl AstNode for InferType {
3982 #[inline]
3983 fn kind() -> SyntaxKind
3984 where
3985 Self: Sized,
3986 {
3987 INFER_TYPE
3988 }
3989 #[inline]
3990 fn can_cast(kind: SyntaxKind) -> bool { kind == INFER_TYPE }
3991 #[inline]
3992 fn cast(syntax: SyntaxNode) -> Option<Self> {
3993 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
3994 }
3995 #[inline]
3996 fn syntax(&self) -> &SyntaxNode { &self.syntax }
3997}
3998impl hash::Hash for InferType {
3999 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
4000}
4001impl Eq for InferType {}
4002impl PartialEq for InferType {
4003 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
4004}
4005impl Clone for InferType {
4006 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
4007}
4008impl fmt::Debug for InferType {
4009 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
4010 f.debug_struct("InferType").field("syntax", &self.syntax).finish()
4011 }
4012}
4013impl AstNode for ItemList {
4014 #[inline]
4015 fn kind() -> SyntaxKind
4016 where
4017 Self: Sized,
4018 {
4019 ITEM_LIST
4020 }
4021 #[inline]
4022 fn can_cast(kind: SyntaxKind) -> bool { kind == ITEM_LIST }
4023 #[inline]
4024 fn cast(syntax: SyntaxNode) -> Option<Self> {
4025 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
4026 }
4027 #[inline]
4028 fn syntax(&self) -> &SyntaxNode { &self.syntax }
4029}
4030impl hash::Hash for ItemList {
4031 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
4032}
4033impl Eq for ItemList {}
4034impl PartialEq for ItemList {
4035 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
4036}
4037impl Clone for ItemList {
4038 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
4039}
4040impl fmt::Debug for ItemList {
4041 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
4042 f.debug_struct("ItemList").field("syntax", &self.syntax).finish()
4043 }
4044}
4045impl AstNode for Label {
4046 #[inline]
4047 fn kind() -> SyntaxKind
4048 where
4049 Self: Sized,
4050 {
4051 LABEL
4052 }
4053 #[inline]
4054 fn can_cast(kind: SyntaxKind) -> bool { kind == LABEL }
4055 #[inline]
4056 fn cast(syntax: SyntaxNode) -> Option<Self> {
4057 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
4058 }
4059 #[inline]
4060 fn syntax(&self) -> &SyntaxNode { &self.syntax }
4061}
4062impl hash::Hash for Label {
4063 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
4064}
4065impl Eq for Label {}
4066impl PartialEq for Label {
4067 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
4068}
4069impl Clone for Label {
4070 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
4071}
4072impl fmt::Debug for Label {
4073 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
4074 f.debug_struct("Label").field("syntax", &self.syntax).finish()
4075 }
4076}
4077impl AstNode for LetElse {
4078 #[inline]
4079 fn kind() -> SyntaxKind
4080 where
4081 Self: Sized,
4082 {
4083 LET_ELSE
4084 }
4085 #[inline]
4086 fn can_cast(kind: SyntaxKind) -> bool { kind == LET_ELSE }
4087 #[inline]
4088 fn cast(syntax: SyntaxNode) -> Option<Self> {
4089 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
4090 }
4091 #[inline]
4092 fn syntax(&self) -> &SyntaxNode { &self.syntax }
4093}
4094impl hash::Hash for LetElse {
4095 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
4096}
4097impl Eq for LetElse {}
4098impl PartialEq for LetElse {
4099 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
4100}
4101impl Clone for LetElse {
4102 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
4103}
4104impl fmt::Debug for LetElse {
4105 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
4106 f.debug_struct("LetElse").field("syntax", &self.syntax).finish()
4107 }
4108}
4109impl AstNode for LetExpr {
4110 #[inline]
4111 fn kind() -> SyntaxKind
4112 where
4113 Self: Sized,
4114 {
4115 LET_EXPR
4116 }
4117 #[inline]
4118 fn can_cast(kind: SyntaxKind) -> bool { kind == LET_EXPR }
4119 #[inline]
4120 fn cast(syntax: SyntaxNode) -> Option<Self> {
4121 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
4122 }
4123 #[inline]
4124 fn syntax(&self) -> &SyntaxNode { &self.syntax }
4125}
4126impl hash::Hash for LetExpr {
4127 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
4128}
4129impl Eq for LetExpr {}
4130impl PartialEq for LetExpr {
4131 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
4132}
4133impl Clone for LetExpr {
4134 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
4135}
4136impl fmt::Debug for LetExpr {
4137 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
4138 f.debug_struct("LetExpr").field("syntax", &self.syntax).finish()
4139 }
4140}
4141impl AstNode for LetStmt {
4142 #[inline]
4143 fn kind() -> SyntaxKind
4144 where
4145 Self: Sized,
4146 {
4147 LET_STMT
4148 }
4149 #[inline]
4150 fn can_cast(kind: SyntaxKind) -> bool { kind == LET_STMT }
4151 #[inline]
4152 fn cast(syntax: SyntaxNode) -> Option<Self> {
4153 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
4154 }
4155 #[inline]
4156 fn syntax(&self) -> &SyntaxNode { &self.syntax }
4157}
4158impl hash::Hash for LetStmt {
4159 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
4160}
4161impl Eq for LetStmt {}
4162impl PartialEq for LetStmt {
4163 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
4164}
4165impl Clone for LetStmt {
4166 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
4167}
4168impl fmt::Debug for LetStmt {
4169 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
4170 f.debug_struct("LetStmt").field("syntax", &self.syntax).finish()
4171 }
4172}
4173impl AstNode for Lifetime {
4174 #[inline]
4175 fn kind() -> SyntaxKind
4176 where
4177 Self: Sized,
4178 {
4179 LIFETIME
4180 }
4181 #[inline]
4182 fn can_cast(kind: SyntaxKind) -> bool { kind == LIFETIME }
4183 #[inline]
4184 fn cast(syntax: SyntaxNode) -> Option<Self> {
4185 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
4186 }
4187 #[inline]
4188 fn syntax(&self) -> &SyntaxNode { &self.syntax }
4189}
4190impl hash::Hash for Lifetime {
4191 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
4192}
4193impl Eq for Lifetime {}
4194impl PartialEq for Lifetime {
4195 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
4196}
4197impl Clone for Lifetime {
4198 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
4199}
4200impl fmt::Debug for Lifetime {
4201 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
4202 f.debug_struct("Lifetime").field("syntax", &self.syntax).finish()
4203 }
4204}
4205impl AstNode for LifetimeArg {
4206 #[inline]
4207 fn kind() -> SyntaxKind
4208 where
4209 Self: Sized,
4210 {
4211 LIFETIME_ARG
4212 }
4213 #[inline]
4214 fn can_cast(kind: SyntaxKind) -> bool { kind == LIFETIME_ARG }
4215 #[inline]
4216 fn cast(syntax: SyntaxNode) -> Option<Self> {
4217 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
4218 }
4219 #[inline]
4220 fn syntax(&self) -> &SyntaxNode { &self.syntax }
4221}
4222impl hash::Hash for LifetimeArg {
4223 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
4224}
4225impl Eq for LifetimeArg {}
4226impl PartialEq for LifetimeArg {
4227 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
4228}
4229impl Clone for LifetimeArg {
4230 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
4231}
4232impl fmt::Debug for LifetimeArg {
4233 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
4234 f.debug_struct("LifetimeArg").field("syntax", &self.syntax).finish()
4235 }
4236}
4237impl AstNode for LifetimeParam {
4238 #[inline]
4239 fn kind() -> SyntaxKind
4240 where
4241 Self: Sized,
4242 {
4243 LIFETIME_PARAM
4244 }
4245 #[inline]
4246 fn can_cast(kind: SyntaxKind) -> bool { kind == LIFETIME_PARAM }
4247 #[inline]
4248 fn cast(syntax: SyntaxNode) -> Option<Self> {
4249 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
4250 }
4251 #[inline]
4252 fn syntax(&self) -> &SyntaxNode { &self.syntax }
4253}
4254impl hash::Hash for LifetimeParam {
4255 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
4256}
4257impl Eq for LifetimeParam {}
4258impl PartialEq for LifetimeParam {
4259 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
4260}
4261impl Clone for LifetimeParam {
4262 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
4263}
4264impl fmt::Debug for LifetimeParam {
4265 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
4266 f.debug_struct("LifetimeParam").field("syntax", &self.syntax).finish()
4267 }
4268}
4269impl AstNode for Literal {
4270 #[inline]
4271 fn kind() -> SyntaxKind
4272 where
4273 Self: Sized,
4274 {
4275 LITERAL
4276 }
4277 #[inline]
4278 fn can_cast(kind: SyntaxKind) -> bool { kind == LITERAL }
4279 #[inline]
4280 fn cast(syntax: SyntaxNode) -> Option<Self> {
4281 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
4282 }
4283 #[inline]
4284 fn syntax(&self) -> &SyntaxNode { &self.syntax }
4285}
4286impl hash::Hash for Literal {
4287 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
4288}
4289impl Eq for Literal {}
4290impl PartialEq for Literal {
4291 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
4292}
4293impl Clone for Literal {
4294 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
4295}
4296impl fmt::Debug for Literal {
4297 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
4298 f.debug_struct("Literal").field("syntax", &self.syntax).finish()
4299 }
4300}
4301impl AstNode for LiteralPat {
4302 #[inline]
4303 fn kind() -> SyntaxKind
4304 where
4305 Self: Sized,
4306 {
4307 LITERAL_PAT
4308 }
4309 #[inline]
4310 fn can_cast(kind: SyntaxKind) -> bool { kind == LITERAL_PAT }
4311 #[inline]
4312 fn cast(syntax: SyntaxNode) -> Option<Self> {
4313 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
4314 }
4315 #[inline]
4316 fn syntax(&self) -> &SyntaxNode { &self.syntax }
4317}
4318impl hash::Hash for LiteralPat {
4319 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
4320}
4321impl Eq for LiteralPat {}
4322impl PartialEq for LiteralPat {
4323 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
4324}
4325impl Clone for LiteralPat {
4326 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
4327}
4328impl fmt::Debug for LiteralPat {
4329 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
4330 f.debug_struct("LiteralPat").field("syntax", &self.syntax).finish()
4331 }
4332}
4333impl AstNode for LoopExpr {
4334 #[inline]
4335 fn kind() -> SyntaxKind
4336 where
4337 Self: Sized,
4338 {
4339 LOOP_EXPR
4340 }
4341 #[inline]
4342 fn can_cast(kind: SyntaxKind) -> bool { kind == LOOP_EXPR }
4343 #[inline]
4344 fn cast(syntax: SyntaxNode) -> Option<Self> {
4345 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
4346 }
4347 #[inline]
4348 fn syntax(&self) -> &SyntaxNode { &self.syntax }
4349}
4350impl hash::Hash for LoopExpr {
4351 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
4352}
4353impl Eq for LoopExpr {}
4354impl PartialEq for LoopExpr {
4355 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
4356}
4357impl Clone for LoopExpr {
4358 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
4359}
4360impl fmt::Debug for LoopExpr {
4361 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
4362 f.debug_struct("LoopExpr").field("syntax", &self.syntax).finish()
4363 }
4364}
4365impl AstNode for MacroCall {
4366 #[inline]
4367 fn kind() -> SyntaxKind
4368 where
4369 Self: Sized,
4370 {
4371 MACRO_CALL
4372 }
4373 #[inline]
4374 fn can_cast(kind: SyntaxKind) -> bool { kind == MACRO_CALL }
4375 #[inline]
4376 fn cast(syntax: SyntaxNode) -> Option<Self> {
4377 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
4378 }
4379 #[inline]
4380 fn syntax(&self) -> &SyntaxNode { &self.syntax }
4381}
4382impl hash::Hash for MacroCall {
4383 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
4384}
4385impl Eq for MacroCall {}
4386impl PartialEq for MacroCall {
4387 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
4388}
4389impl Clone for MacroCall {
4390 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
4391}
4392impl fmt::Debug for MacroCall {
4393 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
4394 f.debug_struct("MacroCall").field("syntax", &self.syntax).finish()
4395 }
4396}
4397impl AstNode for MacroDef {
4398 #[inline]
4399 fn kind() -> SyntaxKind
4400 where
4401 Self: Sized,
4402 {
4403 MACRO_DEF
4404 }
4405 #[inline]
4406 fn can_cast(kind: SyntaxKind) -> bool { kind == MACRO_DEF }
4407 #[inline]
4408 fn cast(syntax: SyntaxNode) -> Option<Self> {
4409 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
4410 }
4411 #[inline]
4412 fn syntax(&self) -> &SyntaxNode { &self.syntax }
4413}
4414impl hash::Hash for MacroDef {
4415 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
4416}
4417impl Eq for MacroDef {}
4418impl PartialEq for MacroDef {
4419 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
4420}
4421impl Clone for MacroDef {
4422 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
4423}
4424impl fmt::Debug for MacroDef {
4425 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
4426 f.debug_struct("MacroDef").field("syntax", &self.syntax).finish()
4427 }
4428}
4429impl AstNode for MacroExpr {
4430 #[inline]
4431 fn kind() -> SyntaxKind
4432 where
4433 Self: Sized,
4434 {
4435 MACRO_EXPR
4436 }
4437 #[inline]
4438 fn can_cast(kind: SyntaxKind) -> bool { kind == MACRO_EXPR }
4439 #[inline]
4440 fn cast(syntax: SyntaxNode) -> Option<Self> {
4441 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
4442 }
4443 #[inline]
4444 fn syntax(&self) -> &SyntaxNode { &self.syntax }
4445}
4446impl hash::Hash for MacroExpr {
4447 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
4448}
4449impl Eq for MacroExpr {}
4450impl PartialEq for MacroExpr {
4451 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
4452}
4453impl Clone for MacroExpr {
4454 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
4455}
4456impl fmt::Debug for MacroExpr {
4457 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
4458 f.debug_struct("MacroExpr").field("syntax", &self.syntax).finish()
4459 }
4460}
4461impl AstNode for MacroItems {
4462 #[inline]
4463 fn kind() -> SyntaxKind
4464 where
4465 Self: Sized,
4466 {
4467 MACRO_ITEMS
4468 }
4469 #[inline]
4470 fn can_cast(kind: SyntaxKind) -> bool { kind == MACRO_ITEMS }
4471 #[inline]
4472 fn cast(syntax: SyntaxNode) -> Option<Self> {
4473 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
4474 }
4475 #[inline]
4476 fn syntax(&self) -> &SyntaxNode { &self.syntax }
4477}
4478impl hash::Hash for MacroItems {
4479 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
4480}
4481impl Eq for MacroItems {}
4482impl PartialEq for MacroItems {
4483 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
4484}
4485impl Clone for MacroItems {
4486 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
4487}
4488impl fmt::Debug for MacroItems {
4489 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
4490 f.debug_struct("MacroItems").field("syntax", &self.syntax).finish()
4491 }
4492}
4493impl AstNode for MacroPat {
4494 #[inline]
4495 fn kind() -> SyntaxKind
4496 where
4497 Self: Sized,
4498 {
4499 MACRO_PAT
4500 }
4501 #[inline]
4502 fn can_cast(kind: SyntaxKind) -> bool { kind == MACRO_PAT }
4503 #[inline]
4504 fn cast(syntax: SyntaxNode) -> Option<Self> {
4505 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
4506 }
4507 #[inline]
4508 fn syntax(&self) -> &SyntaxNode { &self.syntax }
4509}
4510impl hash::Hash for MacroPat {
4511 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
4512}
4513impl Eq for MacroPat {}
4514impl PartialEq for MacroPat {
4515 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
4516}
4517impl Clone for MacroPat {
4518 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
4519}
4520impl fmt::Debug for MacroPat {
4521 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
4522 f.debug_struct("MacroPat").field("syntax", &self.syntax).finish()
4523 }
4524}
4525impl AstNode for MacroRules {
4526 #[inline]
4527 fn kind() -> SyntaxKind
4528 where
4529 Self: Sized,
4530 {
4531 MACRO_RULES
4532 }
4533 #[inline]
4534 fn can_cast(kind: SyntaxKind) -> bool { kind == MACRO_RULES }
4535 #[inline]
4536 fn cast(syntax: SyntaxNode) -> Option<Self> {
4537 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
4538 }
4539 #[inline]
4540 fn syntax(&self) -> &SyntaxNode { &self.syntax }
4541}
4542impl hash::Hash for MacroRules {
4543 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
4544}
4545impl Eq for MacroRules {}
4546impl PartialEq for MacroRules {
4547 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
4548}
4549impl Clone for MacroRules {
4550 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
4551}
4552impl fmt::Debug for MacroRules {
4553 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
4554 f.debug_struct("MacroRules").field("syntax", &self.syntax).finish()
4555 }
4556}
4557impl AstNode for MacroStmts {
4558 #[inline]
4559 fn kind() -> SyntaxKind
4560 where
4561 Self: Sized,
4562 {
4563 MACRO_STMTS
4564 }
4565 #[inline]
4566 fn can_cast(kind: SyntaxKind) -> bool { kind == MACRO_STMTS }
4567 #[inline]
4568 fn cast(syntax: SyntaxNode) -> Option<Self> {
4569 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
4570 }
4571 #[inline]
4572 fn syntax(&self) -> &SyntaxNode { &self.syntax }
4573}
4574impl hash::Hash for MacroStmts {
4575 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
4576}
4577impl Eq for MacroStmts {}
4578impl PartialEq for MacroStmts {
4579 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
4580}
4581impl Clone for MacroStmts {
4582 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
4583}
4584impl fmt::Debug for MacroStmts {
4585 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
4586 f.debug_struct("MacroStmts").field("syntax", &self.syntax).finish()
4587 }
4588}
4589impl AstNode for MacroType {
4590 #[inline]
4591 fn kind() -> SyntaxKind
4592 where
4593 Self: Sized,
4594 {
4595 MACRO_TYPE
4596 }
4597 #[inline]
4598 fn can_cast(kind: SyntaxKind) -> bool { kind == MACRO_TYPE }
4599 #[inline]
4600 fn cast(syntax: SyntaxNode) -> Option<Self> {
4601 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
4602 }
4603 #[inline]
4604 fn syntax(&self) -> &SyntaxNode { &self.syntax }
4605}
4606impl hash::Hash for MacroType {
4607 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
4608}
4609impl Eq for MacroType {}
4610impl PartialEq for MacroType {
4611 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
4612}
4613impl Clone for MacroType {
4614 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
4615}
4616impl fmt::Debug for MacroType {
4617 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
4618 f.debug_struct("MacroType").field("syntax", &self.syntax).finish()
4619 }
4620}
4621impl AstNode for MatchArm {
4622 #[inline]
4623 fn kind() -> SyntaxKind
4624 where
4625 Self: Sized,
4626 {
4627 MATCH_ARM
4628 }
4629 #[inline]
4630 fn can_cast(kind: SyntaxKind) -> bool { kind == MATCH_ARM }
4631 #[inline]
4632 fn cast(syntax: SyntaxNode) -> Option<Self> {
4633 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
4634 }
4635 #[inline]
4636 fn syntax(&self) -> &SyntaxNode { &self.syntax }
4637}
4638impl hash::Hash for MatchArm {
4639 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
4640}
4641impl Eq for MatchArm {}
4642impl PartialEq for MatchArm {
4643 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
4644}
4645impl Clone for MatchArm {
4646 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
4647}
4648impl fmt::Debug for MatchArm {
4649 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
4650 f.debug_struct("MatchArm").field("syntax", &self.syntax).finish()
4651 }
4652}
4653impl AstNode for MatchArmList {
4654 #[inline]
4655 fn kind() -> SyntaxKind
4656 where
4657 Self: Sized,
4658 {
4659 MATCH_ARM_LIST
4660 }
4661 #[inline]
4662 fn can_cast(kind: SyntaxKind) -> bool { kind == MATCH_ARM_LIST }
4663 #[inline]
4664 fn cast(syntax: SyntaxNode) -> Option<Self> {
4665 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
4666 }
4667 #[inline]
4668 fn syntax(&self) -> &SyntaxNode { &self.syntax }
4669}
4670impl hash::Hash for MatchArmList {
4671 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
4672}
4673impl Eq for MatchArmList {}
4674impl PartialEq for MatchArmList {
4675 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
4676}
4677impl Clone for MatchArmList {
4678 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
4679}
4680impl fmt::Debug for MatchArmList {
4681 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
4682 f.debug_struct("MatchArmList").field("syntax", &self.syntax).finish()
4683 }
4684}
4685impl AstNode for MatchExpr {
4686 #[inline]
4687 fn kind() -> SyntaxKind
4688 where
4689 Self: Sized,
4690 {
4691 MATCH_EXPR
4692 }
4693 #[inline]
4694 fn can_cast(kind: SyntaxKind) -> bool { kind == MATCH_EXPR }
4695 #[inline]
4696 fn cast(syntax: SyntaxNode) -> Option<Self> {
4697 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
4698 }
4699 #[inline]
4700 fn syntax(&self) -> &SyntaxNode { &self.syntax }
4701}
4702impl hash::Hash for MatchExpr {
4703 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
4704}
4705impl Eq for MatchExpr {}
4706impl PartialEq for MatchExpr {
4707 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
4708}
4709impl Clone for MatchExpr {
4710 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
4711}
4712impl fmt::Debug for MatchExpr {
4713 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
4714 f.debug_struct("MatchExpr").field("syntax", &self.syntax).finish()
4715 }
4716}
4717impl AstNode for MatchGuard {
4718 #[inline]
4719 fn kind() -> SyntaxKind
4720 where
4721 Self: Sized,
4722 {
4723 MATCH_GUARD
4724 }
4725 #[inline]
4726 fn can_cast(kind: SyntaxKind) -> bool { kind == MATCH_GUARD }
4727 #[inline]
4728 fn cast(syntax: SyntaxNode) -> Option<Self> {
4729 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
4730 }
4731 #[inline]
4732 fn syntax(&self) -> &SyntaxNode { &self.syntax }
4733}
4734impl hash::Hash for MatchGuard {
4735 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
4736}
4737impl Eq for MatchGuard {}
4738impl PartialEq for MatchGuard {
4739 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
4740}
4741impl Clone for MatchGuard {
4742 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
4743}
4744impl fmt::Debug for MatchGuard {
4745 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
4746 f.debug_struct("MatchGuard").field("syntax", &self.syntax).finish()
4747 }
4748}
4749impl AstNode for Meta {
4750 #[inline]
4751 fn kind() -> SyntaxKind
4752 where
4753 Self: Sized,
4754 {
4755 META
4756 }
4757 #[inline]
4758 fn can_cast(kind: SyntaxKind) -> bool { kind == META }
4759 #[inline]
4760 fn cast(syntax: SyntaxNode) -> Option<Self> {
4761 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
4762 }
4763 #[inline]
4764 fn syntax(&self) -> &SyntaxNode { &self.syntax }
4765}
4766impl hash::Hash for Meta {
4767 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
4768}
4769impl Eq for Meta {}
4770impl PartialEq for Meta {
4771 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
4772}
4773impl Clone for Meta {
4774 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
4775}
4776impl fmt::Debug for Meta {
4777 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
4778 f.debug_struct("Meta").field("syntax", &self.syntax).finish()
4779 }
4780}
4781impl AstNode for MethodCallExpr {
4782 #[inline]
4783 fn kind() -> SyntaxKind
4784 where
4785 Self: Sized,
4786 {
4787 METHOD_CALL_EXPR
4788 }
4789 #[inline]
4790 fn can_cast(kind: SyntaxKind) -> bool { kind == METHOD_CALL_EXPR }
4791 #[inline]
4792 fn cast(syntax: SyntaxNode) -> Option<Self> {
4793 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
4794 }
4795 #[inline]
4796 fn syntax(&self) -> &SyntaxNode { &self.syntax }
4797}
4798impl hash::Hash for MethodCallExpr {
4799 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
4800}
4801impl Eq for MethodCallExpr {}
4802impl PartialEq for MethodCallExpr {
4803 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
4804}
4805impl Clone for MethodCallExpr {
4806 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
4807}
4808impl fmt::Debug for MethodCallExpr {
4809 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
4810 f.debug_struct("MethodCallExpr").field("syntax", &self.syntax).finish()
4811 }
4812}
4813impl AstNode for Module {
4814 #[inline]
4815 fn kind() -> SyntaxKind
4816 where
4817 Self: Sized,
4818 {
4819 MODULE
4820 }
4821 #[inline]
4822 fn can_cast(kind: SyntaxKind) -> bool { kind == MODULE }
4823 #[inline]
4824 fn cast(syntax: SyntaxNode) -> Option<Self> {
4825 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
4826 }
4827 #[inline]
4828 fn syntax(&self) -> &SyntaxNode { &self.syntax }
4829}
4830impl hash::Hash for Module {
4831 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
4832}
4833impl Eq for Module {}
4834impl PartialEq for Module {
4835 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
4836}
4837impl Clone for Module {
4838 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
4839}
4840impl fmt::Debug for Module {
4841 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
4842 f.debug_struct("Module").field("syntax", &self.syntax).finish()
4843 }
4844}
4845impl AstNode for Name {
4846 #[inline]
4847 fn kind() -> SyntaxKind
4848 where
4849 Self: Sized,
4850 {
4851 NAME
4852 }
4853 #[inline]
4854 fn can_cast(kind: SyntaxKind) -> bool { kind == NAME }
4855 #[inline]
4856 fn cast(syntax: SyntaxNode) -> Option<Self> {
4857 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
4858 }
4859 #[inline]
4860 fn syntax(&self) -> &SyntaxNode { &self.syntax }
4861}
4862impl hash::Hash for Name {
4863 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
4864}
4865impl Eq for Name {}
4866impl PartialEq for Name {
4867 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
4868}
4869impl Clone for Name {
4870 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
4871}
4872impl fmt::Debug for Name {
4873 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
4874 f.debug_struct("Name").field("syntax", &self.syntax).finish()
4875 }
4876}
4877impl AstNode for NameRef {
4878 #[inline]
4879 fn kind() -> SyntaxKind
4880 where
4881 Self: Sized,
4882 {
4883 NAME_REF
4884 }
4885 #[inline]
4886 fn can_cast(kind: SyntaxKind) -> bool { kind == NAME_REF }
4887 #[inline]
4888 fn cast(syntax: SyntaxNode) -> Option<Self> {
4889 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
4890 }
4891 #[inline]
4892 fn syntax(&self) -> &SyntaxNode { &self.syntax }
4893}
4894impl hash::Hash for NameRef {
4895 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
4896}
4897impl Eq for NameRef {}
4898impl PartialEq for NameRef {
4899 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
4900}
4901impl Clone for NameRef {
4902 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
4903}
4904impl fmt::Debug for NameRef {
4905 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
4906 f.debug_struct("NameRef").field("syntax", &self.syntax).finish()
4907 }
4908}
4909impl AstNode for NeverType {
4910 #[inline]
4911 fn kind() -> SyntaxKind
4912 where
4913 Self: Sized,
4914 {
4915 NEVER_TYPE
4916 }
4917 #[inline]
4918 fn can_cast(kind: SyntaxKind) -> bool { kind == NEVER_TYPE }
4919 #[inline]
4920 fn cast(syntax: SyntaxNode) -> Option<Self> {
4921 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
4922 }
4923 #[inline]
4924 fn syntax(&self) -> &SyntaxNode { &self.syntax }
4925}
4926impl hash::Hash for NeverType {
4927 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
4928}
4929impl Eq for NeverType {}
4930impl PartialEq for NeverType {
4931 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
4932}
4933impl Clone for NeverType {
4934 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
4935}
4936impl fmt::Debug for NeverType {
4937 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
4938 f.debug_struct("NeverType").field("syntax", &self.syntax).finish()
4939 }
4940}
4941impl AstNode for OffsetOfExpr {
4942 #[inline]
4943 fn kind() -> SyntaxKind
4944 where
4945 Self: Sized,
4946 {
4947 OFFSET_OF_EXPR
4948 }
4949 #[inline]
4950 fn can_cast(kind: SyntaxKind) -> bool { kind == OFFSET_OF_EXPR }
4951 #[inline]
4952 fn cast(syntax: SyntaxNode) -> Option<Self> {
4953 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
4954 }
4955 #[inline]
4956 fn syntax(&self) -> &SyntaxNode { &self.syntax }
4957}
4958impl hash::Hash for OffsetOfExpr {
4959 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
4960}
4961impl Eq for OffsetOfExpr {}
4962impl PartialEq for OffsetOfExpr {
4963 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
4964}
4965impl Clone for OffsetOfExpr {
4966 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
4967}
4968impl fmt::Debug for OffsetOfExpr {
4969 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
4970 f.debug_struct("OffsetOfExpr").field("syntax", &self.syntax).finish()
4971 }
4972}
4973impl AstNode for OrPat {
4974 #[inline]
4975 fn kind() -> SyntaxKind
4976 where
4977 Self: Sized,
4978 {
4979 OR_PAT
4980 }
4981 #[inline]
4982 fn can_cast(kind: SyntaxKind) -> bool { kind == OR_PAT }
4983 #[inline]
4984 fn cast(syntax: SyntaxNode) -> Option<Self> {
4985 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
4986 }
4987 #[inline]
4988 fn syntax(&self) -> &SyntaxNode { &self.syntax }
4989}
4990impl hash::Hash for OrPat {
4991 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
4992}
4993impl Eq for OrPat {}
4994impl PartialEq for OrPat {
4995 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
4996}
4997impl Clone for OrPat {
4998 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
4999}
5000impl fmt::Debug for OrPat {
5001 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
5002 f.debug_struct("OrPat").field("syntax", &self.syntax).finish()
5003 }
5004}
5005impl AstNode for Param {
5006 #[inline]
5007 fn kind() -> SyntaxKind
5008 where
5009 Self: Sized,
5010 {
5011 PARAM
5012 }
5013 #[inline]
5014 fn can_cast(kind: SyntaxKind) -> bool { kind == PARAM }
5015 #[inline]
5016 fn cast(syntax: SyntaxNode) -> Option<Self> {
5017 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
5018 }
5019 #[inline]
5020 fn syntax(&self) -> &SyntaxNode { &self.syntax }
5021}
5022impl hash::Hash for Param {
5023 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
5024}
5025impl Eq for Param {}
5026impl PartialEq for Param {
5027 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
5028}
5029impl Clone for Param {
5030 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
5031}
5032impl fmt::Debug for Param {
5033 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
5034 f.debug_struct("Param").field("syntax", &self.syntax).finish()
5035 }
5036}
5037impl AstNode for ParamList {
5038 #[inline]
5039 fn kind() -> SyntaxKind
5040 where
5041 Self: Sized,
5042 {
5043 PARAM_LIST
5044 }
5045 #[inline]
5046 fn can_cast(kind: SyntaxKind) -> bool { kind == PARAM_LIST }
5047 #[inline]
5048 fn cast(syntax: SyntaxNode) -> Option<Self> {
5049 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
5050 }
5051 #[inline]
5052 fn syntax(&self) -> &SyntaxNode { &self.syntax }
5053}
5054impl hash::Hash for ParamList {
5055 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
5056}
5057impl Eq for ParamList {}
5058impl PartialEq for ParamList {
5059 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
5060}
5061impl Clone for ParamList {
5062 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
5063}
5064impl fmt::Debug for ParamList {
5065 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
5066 f.debug_struct("ParamList").field("syntax", &self.syntax).finish()
5067 }
5068}
5069impl AstNode for ParenExpr {
5070 #[inline]
5071 fn kind() -> SyntaxKind
5072 where
5073 Self: Sized,
5074 {
5075 PAREN_EXPR
5076 }
5077 #[inline]
5078 fn can_cast(kind: SyntaxKind) -> bool { kind == PAREN_EXPR }
5079 #[inline]
5080 fn cast(syntax: SyntaxNode) -> Option<Self> {
5081 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
5082 }
5083 #[inline]
5084 fn syntax(&self) -> &SyntaxNode { &self.syntax }
5085}
5086impl hash::Hash for ParenExpr {
5087 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
5088}
5089impl Eq for ParenExpr {}
5090impl PartialEq for ParenExpr {
5091 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
5092}
5093impl Clone for ParenExpr {
5094 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
5095}
5096impl fmt::Debug for ParenExpr {
5097 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
5098 f.debug_struct("ParenExpr").field("syntax", &self.syntax).finish()
5099 }
5100}
5101impl AstNode for ParenPat {
5102 #[inline]
5103 fn kind() -> SyntaxKind
5104 where
5105 Self: Sized,
5106 {
5107 PAREN_PAT
5108 }
5109 #[inline]
5110 fn can_cast(kind: SyntaxKind) -> bool { kind == PAREN_PAT }
5111 #[inline]
5112 fn cast(syntax: SyntaxNode) -> Option<Self> {
5113 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
5114 }
5115 #[inline]
5116 fn syntax(&self) -> &SyntaxNode { &self.syntax }
5117}
5118impl hash::Hash for ParenPat {
5119 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
5120}
5121impl Eq for ParenPat {}
5122impl PartialEq for ParenPat {
5123 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
5124}
5125impl Clone for ParenPat {
5126 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
5127}
5128impl fmt::Debug for ParenPat {
5129 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
5130 f.debug_struct("ParenPat").field("syntax", &self.syntax).finish()
5131 }
5132}
5133impl AstNode for ParenType {
5134 #[inline]
5135 fn kind() -> SyntaxKind
5136 where
5137 Self: Sized,
5138 {
5139 PAREN_TYPE
5140 }
5141 #[inline]
5142 fn can_cast(kind: SyntaxKind) -> bool { kind == PAREN_TYPE }
5143 #[inline]
5144 fn cast(syntax: SyntaxNode) -> Option<Self> {
5145 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
5146 }
5147 #[inline]
5148 fn syntax(&self) -> &SyntaxNode { &self.syntax }
5149}
5150impl hash::Hash for ParenType {
5151 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
5152}
5153impl Eq for ParenType {}
5154impl PartialEq for ParenType {
5155 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
5156}
5157impl Clone for ParenType {
5158 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
5159}
5160impl fmt::Debug for ParenType {
5161 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
5162 f.debug_struct("ParenType").field("syntax", &self.syntax).finish()
5163 }
5164}
5165impl AstNode for ParenthesizedArgList {
5166 #[inline]
5167 fn kind() -> SyntaxKind
5168 where
5169 Self: Sized,
5170 {
5171 PARENTHESIZED_ARG_LIST
5172 }
5173 #[inline]
5174 fn can_cast(kind: SyntaxKind) -> bool { kind == PARENTHESIZED_ARG_LIST }
5175 #[inline]
5176 fn cast(syntax: SyntaxNode) -> Option<Self> {
5177 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
5178 }
5179 #[inline]
5180 fn syntax(&self) -> &SyntaxNode { &self.syntax }
5181}
5182impl hash::Hash for ParenthesizedArgList {
5183 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
5184}
5185impl Eq for ParenthesizedArgList {}
5186impl PartialEq for ParenthesizedArgList {
5187 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
5188}
5189impl Clone for ParenthesizedArgList {
5190 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
5191}
5192impl fmt::Debug for ParenthesizedArgList {
5193 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
5194 f.debug_struct("ParenthesizedArgList").field("syntax", &self.syntax).finish()
5195 }
5196}
5197impl AstNode for Path {
5198 #[inline]
5199 fn kind() -> SyntaxKind
5200 where
5201 Self: Sized,
5202 {
5203 PATH
5204 }
5205 #[inline]
5206 fn can_cast(kind: SyntaxKind) -> bool { kind == PATH }
5207 #[inline]
5208 fn cast(syntax: SyntaxNode) -> Option<Self> {
5209 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
5210 }
5211 #[inline]
5212 fn syntax(&self) -> &SyntaxNode { &self.syntax }
5213}
5214impl hash::Hash for Path {
5215 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
5216}
5217impl Eq for Path {}
5218impl PartialEq for Path {
5219 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
5220}
5221impl Clone for Path {
5222 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
5223}
5224impl fmt::Debug for Path {
5225 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
5226 f.debug_struct("Path").field("syntax", &self.syntax).finish()
5227 }
5228}
5229impl AstNode for PathExpr {
5230 #[inline]
5231 fn kind() -> SyntaxKind
5232 where
5233 Self: Sized,
5234 {
5235 PATH_EXPR
5236 }
5237 #[inline]
5238 fn can_cast(kind: SyntaxKind) -> bool { kind == PATH_EXPR }
5239 #[inline]
5240 fn cast(syntax: SyntaxNode) -> Option<Self> {
5241 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
5242 }
5243 #[inline]
5244 fn syntax(&self) -> &SyntaxNode { &self.syntax }
5245}
5246impl hash::Hash for PathExpr {
5247 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
5248}
5249impl Eq for PathExpr {}
5250impl PartialEq for PathExpr {
5251 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
5252}
5253impl Clone for PathExpr {
5254 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
5255}
5256impl fmt::Debug for PathExpr {
5257 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
5258 f.debug_struct("PathExpr").field("syntax", &self.syntax).finish()
5259 }
5260}
5261impl AstNode for PathPat {
5262 #[inline]
5263 fn kind() -> SyntaxKind
5264 where
5265 Self: Sized,
5266 {
5267 PATH_PAT
5268 }
5269 #[inline]
5270 fn can_cast(kind: SyntaxKind) -> bool { kind == PATH_PAT }
5271 #[inline]
5272 fn cast(syntax: SyntaxNode) -> Option<Self> {
5273 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
5274 }
5275 #[inline]
5276 fn syntax(&self) -> &SyntaxNode { &self.syntax }
5277}
5278impl hash::Hash for PathPat {
5279 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
5280}
5281impl Eq for PathPat {}
5282impl PartialEq for PathPat {
5283 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
5284}
5285impl Clone for PathPat {
5286 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
5287}
5288impl fmt::Debug for PathPat {
5289 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
5290 f.debug_struct("PathPat").field("syntax", &self.syntax).finish()
5291 }
5292}
5293impl AstNode for PathSegment {
5294 #[inline]
5295 fn kind() -> SyntaxKind
5296 where
5297 Self: Sized,
5298 {
5299 PATH_SEGMENT
5300 }
5301 #[inline]
5302 fn can_cast(kind: SyntaxKind) -> bool { kind == PATH_SEGMENT }
5303 #[inline]
5304 fn cast(syntax: SyntaxNode) -> Option<Self> {
5305 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
5306 }
5307 #[inline]
5308 fn syntax(&self) -> &SyntaxNode { &self.syntax }
5309}
5310impl hash::Hash for PathSegment {
5311 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
5312}
5313impl Eq for PathSegment {}
5314impl PartialEq for PathSegment {
5315 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
5316}
5317impl Clone for PathSegment {
5318 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
5319}
5320impl fmt::Debug for PathSegment {
5321 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
5322 f.debug_struct("PathSegment").field("syntax", &self.syntax).finish()
5323 }
5324}
5325impl AstNode for PathType {
5326 #[inline]
5327 fn kind() -> SyntaxKind
5328 where
5329 Self: Sized,
5330 {
5331 PATH_TYPE
5332 }
5333 #[inline]
5334 fn can_cast(kind: SyntaxKind) -> bool { kind == PATH_TYPE }
5335 #[inline]
5336 fn cast(syntax: SyntaxNode) -> Option<Self> {
5337 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
5338 }
5339 #[inline]
5340 fn syntax(&self) -> &SyntaxNode { &self.syntax }
5341}
5342impl hash::Hash for PathType {
5343 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
5344}
5345impl Eq for PathType {}
5346impl PartialEq for PathType {
5347 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
5348}
5349impl Clone for PathType {
5350 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
5351}
5352impl fmt::Debug for PathType {
5353 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
5354 f.debug_struct("PathType").field("syntax", &self.syntax).finish()
5355 }
5356}
5357impl AstNode for PrefixExpr {
5358 #[inline]
5359 fn kind() -> SyntaxKind
5360 where
5361 Self: Sized,
5362 {
5363 PREFIX_EXPR
5364 }
5365 #[inline]
5366 fn can_cast(kind: SyntaxKind) -> bool { kind == PREFIX_EXPR }
5367 #[inline]
5368 fn cast(syntax: SyntaxNode) -> Option<Self> {
5369 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
5370 }
5371 #[inline]
5372 fn syntax(&self) -> &SyntaxNode { &self.syntax }
5373}
5374impl hash::Hash for PrefixExpr {
5375 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
5376}
5377impl Eq for PrefixExpr {}
5378impl PartialEq for PrefixExpr {
5379 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
5380}
5381impl Clone for PrefixExpr {
5382 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
5383}
5384impl fmt::Debug for PrefixExpr {
5385 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
5386 f.debug_struct("PrefixExpr").field("syntax", &self.syntax).finish()
5387 }
5388}
5389impl AstNode for PtrType {
5390 #[inline]
5391 fn kind() -> SyntaxKind
5392 where
5393 Self: Sized,
5394 {
5395 PTR_TYPE
5396 }
5397 #[inline]
5398 fn can_cast(kind: SyntaxKind) -> bool { kind == PTR_TYPE }
5399 #[inline]
5400 fn cast(syntax: SyntaxNode) -> Option<Self> {
5401 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
5402 }
5403 #[inline]
5404 fn syntax(&self) -> &SyntaxNode { &self.syntax }
5405}
5406impl hash::Hash for PtrType {
5407 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
5408}
5409impl Eq for PtrType {}
5410impl PartialEq for PtrType {
5411 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
5412}
5413impl Clone for PtrType {
5414 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
5415}
5416impl fmt::Debug for PtrType {
5417 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
5418 f.debug_struct("PtrType").field("syntax", &self.syntax).finish()
5419 }
5420}
5421impl AstNode for RangeExpr {
5422 #[inline]
5423 fn kind() -> SyntaxKind
5424 where
5425 Self: Sized,
5426 {
5427 RANGE_EXPR
5428 }
5429 #[inline]
5430 fn can_cast(kind: SyntaxKind) -> bool { kind == RANGE_EXPR }
5431 #[inline]
5432 fn cast(syntax: SyntaxNode) -> Option<Self> {
5433 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
5434 }
5435 #[inline]
5436 fn syntax(&self) -> &SyntaxNode { &self.syntax }
5437}
5438impl hash::Hash for RangeExpr {
5439 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
5440}
5441impl Eq for RangeExpr {}
5442impl PartialEq for RangeExpr {
5443 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
5444}
5445impl Clone for RangeExpr {
5446 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
5447}
5448impl fmt::Debug for RangeExpr {
5449 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
5450 f.debug_struct("RangeExpr").field("syntax", &self.syntax).finish()
5451 }
5452}
5453impl AstNode for RangePat {
5454 #[inline]
5455 fn kind() -> SyntaxKind
5456 where
5457 Self: Sized,
5458 {
5459 RANGE_PAT
5460 }
5461 #[inline]
5462 fn can_cast(kind: SyntaxKind) -> bool { kind == RANGE_PAT }
5463 #[inline]
5464 fn cast(syntax: SyntaxNode) -> Option<Self> {
5465 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
5466 }
5467 #[inline]
5468 fn syntax(&self) -> &SyntaxNode { &self.syntax }
5469}
5470impl hash::Hash for RangePat {
5471 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
5472}
5473impl Eq for RangePat {}
5474impl PartialEq for RangePat {
5475 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
5476}
5477impl Clone for RangePat {
5478 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
5479}
5480impl fmt::Debug for RangePat {
5481 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
5482 f.debug_struct("RangePat").field("syntax", &self.syntax).finish()
5483 }
5484}
5485impl AstNode for RecordExpr {
5486 #[inline]
5487 fn kind() -> SyntaxKind
5488 where
5489 Self: Sized,
5490 {
5491 RECORD_EXPR
5492 }
5493 #[inline]
5494 fn can_cast(kind: SyntaxKind) -> bool { kind == RECORD_EXPR }
5495 #[inline]
5496 fn cast(syntax: SyntaxNode) -> Option<Self> {
5497 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
5498 }
5499 #[inline]
5500 fn syntax(&self) -> &SyntaxNode { &self.syntax }
5501}
5502impl hash::Hash for RecordExpr {
5503 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
5504}
5505impl Eq for RecordExpr {}
5506impl PartialEq for RecordExpr {
5507 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
5508}
5509impl Clone for RecordExpr {
5510 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
5511}
5512impl fmt::Debug for RecordExpr {
5513 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
5514 f.debug_struct("RecordExpr").field("syntax", &self.syntax).finish()
5515 }
5516}
5517impl AstNode for RecordExprField {
5518 #[inline]
5519 fn kind() -> SyntaxKind
5520 where
5521 Self: Sized,
5522 {
5523 RECORD_EXPR_FIELD
5524 }
5525 #[inline]
5526 fn can_cast(kind: SyntaxKind) -> bool { kind == RECORD_EXPR_FIELD }
5527 #[inline]
5528 fn cast(syntax: SyntaxNode) -> Option<Self> {
5529 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
5530 }
5531 #[inline]
5532 fn syntax(&self) -> &SyntaxNode { &self.syntax }
5533}
5534impl hash::Hash for RecordExprField {
5535 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
5536}
5537impl Eq for RecordExprField {}
5538impl PartialEq for RecordExprField {
5539 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
5540}
5541impl Clone for RecordExprField {
5542 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
5543}
5544impl fmt::Debug for RecordExprField {
5545 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
5546 f.debug_struct("RecordExprField").field("syntax", &self.syntax).finish()
5547 }
5548}
5549impl AstNode for RecordExprFieldList {
5550 #[inline]
5551 fn kind() -> SyntaxKind
5552 where
5553 Self: Sized,
5554 {
5555 RECORD_EXPR_FIELD_LIST
5556 }
5557 #[inline]
5558 fn can_cast(kind: SyntaxKind) -> bool { kind == RECORD_EXPR_FIELD_LIST }
5559 #[inline]
5560 fn cast(syntax: SyntaxNode) -> Option<Self> {
5561 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
5562 }
5563 #[inline]
5564 fn syntax(&self) -> &SyntaxNode { &self.syntax }
5565}
5566impl hash::Hash for RecordExprFieldList {
5567 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
5568}
5569impl Eq for RecordExprFieldList {}
5570impl PartialEq for RecordExprFieldList {
5571 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
5572}
5573impl Clone for RecordExprFieldList {
5574 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
5575}
5576impl fmt::Debug for RecordExprFieldList {
5577 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
5578 f.debug_struct("RecordExprFieldList").field("syntax", &self.syntax).finish()
5579 }
5580}
5581impl AstNode for RecordField {
5582 #[inline]
5583 fn kind() -> SyntaxKind
5584 where
5585 Self: Sized,
5586 {
5587 RECORD_FIELD
5588 }
5589 #[inline]
5590 fn can_cast(kind: SyntaxKind) -> bool { kind == RECORD_FIELD }
5591 #[inline]
5592 fn cast(syntax: SyntaxNode) -> Option<Self> {
5593 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
5594 }
5595 #[inline]
5596 fn syntax(&self) -> &SyntaxNode { &self.syntax }
5597}
5598impl hash::Hash for RecordField {
5599 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
5600}
5601impl Eq for RecordField {}
5602impl PartialEq for RecordField {
5603 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
5604}
5605impl Clone for RecordField {
5606 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
5607}
5608impl fmt::Debug for RecordField {
5609 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
5610 f.debug_struct("RecordField").field("syntax", &self.syntax).finish()
5611 }
5612}
5613impl AstNode for RecordFieldList {
5614 #[inline]
5615 fn kind() -> SyntaxKind
5616 where
5617 Self: Sized,
5618 {
5619 RECORD_FIELD_LIST
5620 }
5621 #[inline]
5622 fn can_cast(kind: SyntaxKind) -> bool { kind == RECORD_FIELD_LIST }
5623 #[inline]
5624 fn cast(syntax: SyntaxNode) -> Option<Self> {
5625 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
5626 }
5627 #[inline]
5628 fn syntax(&self) -> &SyntaxNode { &self.syntax }
5629}
5630impl hash::Hash for RecordFieldList {
5631 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
5632}
5633impl Eq for RecordFieldList {}
5634impl PartialEq for RecordFieldList {
5635 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
5636}
5637impl Clone for RecordFieldList {
5638 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
5639}
5640impl fmt::Debug for RecordFieldList {
5641 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
5642 f.debug_struct("RecordFieldList").field("syntax", &self.syntax).finish()
5643 }
5644}
5645impl AstNode for RecordPat {
5646 #[inline]
5647 fn kind() -> SyntaxKind
5648 where
5649 Self: Sized,
5650 {
5651 RECORD_PAT
5652 }
5653 #[inline]
5654 fn can_cast(kind: SyntaxKind) -> bool { kind == RECORD_PAT }
5655 #[inline]
5656 fn cast(syntax: SyntaxNode) -> Option<Self> {
5657 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
5658 }
5659 #[inline]
5660 fn syntax(&self) -> &SyntaxNode { &self.syntax }
5661}
5662impl hash::Hash for RecordPat {
5663 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
5664}
5665impl Eq for RecordPat {}
5666impl PartialEq for RecordPat {
5667 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
5668}
5669impl Clone for RecordPat {
5670 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
5671}
5672impl fmt::Debug for RecordPat {
5673 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
5674 f.debug_struct("RecordPat").field("syntax", &self.syntax).finish()
5675 }
5676}
5677impl AstNode for RecordPatField {
5678 #[inline]
5679 fn kind() -> SyntaxKind
5680 where
5681 Self: Sized,
5682 {
5683 RECORD_PAT_FIELD
5684 }
5685 #[inline]
5686 fn can_cast(kind: SyntaxKind) -> bool { kind == RECORD_PAT_FIELD }
5687 #[inline]
5688 fn cast(syntax: SyntaxNode) -> Option<Self> {
5689 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
5690 }
5691 #[inline]
5692 fn syntax(&self) -> &SyntaxNode { &self.syntax }
5693}
5694impl hash::Hash for RecordPatField {
5695 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
5696}
5697impl Eq for RecordPatField {}
5698impl PartialEq for RecordPatField {
5699 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
5700}
5701impl Clone for RecordPatField {
5702 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
5703}
5704impl fmt::Debug for RecordPatField {
5705 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
5706 f.debug_struct("RecordPatField").field("syntax", &self.syntax).finish()
5707 }
5708}
5709impl AstNode for RecordPatFieldList {
5710 #[inline]
5711 fn kind() -> SyntaxKind
5712 where
5713 Self: Sized,
5714 {
5715 RECORD_PAT_FIELD_LIST
5716 }
5717 #[inline]
5718 fn can_cast(kind: SyntaxKind) -> bool { kind == RECORD_PAT_FIELD_LIST }
5719 #[inline]
5720 fn cast(syntax: SyntaxNode) -> Option<Self> {
5721 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
5722 }
5723 #[inline]
5724 fn syntax(&self) -> &SyntaxNode { &self.syntax }
5725}
5726impl hash::Hash for RecordPatFieldList {
5727 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
5728}
5729impl Eq for RecordPatFieldList {}
5730impl PartialEq for RecordPatFieldList {
5731 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
5732}
5733impl Clone for RecordPatFieldList {
5734 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
5735}
5736impl fmt::Debug for RecordPatFieldList {
5737 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
5738 f.debug_struct("RecordPatFieldList").field("syntax", &self.syntax).finish()
5739 }
5740}
5741impl AstNode for RefExpr {
5742 #[inline]
5743 fn kind() -> SyntaxKind
5744 where
5745 Self: Sized,
5746 {
5747 REF_EXPR
5748 }
5749 #[inline]
5750 fn can_cast(kind: SyntaxKind) -> bool { kind == REF_EXPR }
5751 #[inline]
5752 fn cast(syntax: SyntaxNode) -> Option<Self> {
5753 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
5754 }
5755 #[inline]
5756 fn syntax(&self) -> &SyntaxNode { &self.syntax }
5757}
5758impl hash::Hash for RefExpr {
5759 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
5760}
5761impl Eq for RefExpr {}
5762impl PartialEq for RefExpr {
5763 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
5764}
5765impl Clone for RefExpr {
5766 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
5767}
5768impl fmt::Debug for RefExpr {
5769 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
5770 f.debug_struct("RefExpr").field("syntax", &self.syntax).finish()
5771 }
5772}
5773impl AstNode for RefPat {
5774 #[inline]
5775 fn kind() -> SyntaxKind
5776 where
5777 Self: Sized,
5778 {
5779 REF_PAT
5780 }
5781 #[inline]
5782 fn can_cast(kind: SyntaxKind) -> bool { kind == REF_PAT }
5783 #[inline]
5784 fn cast(syntax: SyntaxNode) -> Option<Self> {
5785 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
5786 }
5787 #[inline]
5788 fn syntax(&self) -> &SyntaxNode { &self.syntax }
5789}
5790impl hash::Hash for RefPat {
5791 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
5792}
5793impl Eq for RefPat {}
5794impl PartialEq for RefPat {
5795 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
5796}
5797impl Clone for RefPat {
5798 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
5799}
5800impl fmt::Debug for RefPat {
5801 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
5802 f.debug_struct("RefPat").field("syntax", &self.syntax).finish()
5803 }
5804}
5805impl AstNode for RefType {
5806 #[inline]
5807 fn kind() -> SyntaxKind
5808 where
5809 Self: Sized,
5810 {
5811 REF_TYPE
5812 }
5813 #[inline]
5814 fn can_cast(kind: SyntaxKind) -> bool { kind == REF_TYPE }
5815 #[inline]
5816 fn cast(syntax: SyntaxNode) -> Option<Self> {
5817 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
5818 }
5819 #[inline]
5820 fn syntax(&self) -> &SyntaxNode { &self.syntax }
5821}
5822impl hash::Hash for RefType {
5823 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
5824}
5825impl Eq for RefType {}
5826impl PartialEq for RefType {
5827 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
5828}
5829impl Clone for RefType {
5830 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
5831}
5832impl fmt::Debug for RefType {
5833 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
5834 f.debug_struct("RefType").field("syntax", &self.syntax).finish()
5835 }
5836}
5837impl AstNode for Rename {
5838 #[inline]
5839 fn kind() -> SyntaxKind
5840 where
5841 Self: Sized,
5842 {
5843 RENAME
5844 }
5845 #[inline]
5846 fn can_cast(kind: SyntaxKind) -> bool { kind == RENAME }
5847 #[inline]
5848 fn cast(syntax: SyntaxNode) -> Option<Self> {
5849 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
5850 }
5851 #[inline]
5852 fn syntax(&self) -> &SyntaxNode { &self.syntax }
5853}
5854impl hash::Hash for Rename {
5855 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
5856}
5857impl Eq for Rename {}
5858impl PartialEq for Rename {
5859 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
5860}
5861impl Clone for Rename {
5862 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
5863}
5864impl fmt::Debug for Rename {
5865 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
5866 f.debug_struct("Rename").field("syntax", &self.syntax).finish()
5867 }
5868}
5869impl AstNode for RestPat {
5870 #[inline]
5871 fn kind() -> SyntaxKind
5872 where
5873 Self: Sized,
5874 {
5875 REST_PAT
5876 }
5877 #[inline]
5878 fn can_cast(kind: SyntaxKind) -> bool { kind == REST_PAT }
5879 #[inline]
5880 fn cast(syntax: SyntaxNode) -> Option<Self> {
5881 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
5882 }
5883 #[inline]
5884 fn syntax(&self) -> &SyntaxNode { &self.syntax }
5885}
5886impl hash::Hash for RestPat {
5887 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
5888}
5889impl Eq for RestPat {}
5890impl PartialEq for RestPat {
5891 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
5892}
5893impl Clone for RestPat {
5894 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
5895}
5896impl fmt::Debug for RestPat {
5897 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
5898 f.debug_struct("RestPat").field("syntax", &self.syntax).finish()
5899 }
5900}
5901impl AstNode for RetType {
5902 #[inline]
5903 fn kind() -> SyntaxKind
5904 where
5905 Self: Sized,
5906 {
5907 RET_TYPE
5908 }
5909 #[inline]
5910 fn can_cast(kind: SyntaxKind) -> bool { kind == RET_TYPE }
5911 #[inline]
5912 fn cast(syntax: SyntaxNode) -> Option<Self> {
5913 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
5914 }
5915 #[inline]
5916 fn syntax(&self) -> &SyntaxNode { &self.syntax }
5917}
5918impl hash::Hash for RetType {
5919 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
5920}
5921impl Eq for RetType {}
5922impl PartialEq for RetType {
5923 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
5924}
5925impl Clone for RetType {
5926 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
5927}
5928impl fmt::Debug for RetType {
5929 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
5930 f.debug_struct("RetType").field("syntax", &self.syntax).finish()
5931 }
5932}
5933impl AstNode for ReturnExpr {
5934 #[inline]
5935 fn kind() -> SyntaxKind
5936 where
5937 Self: Sized,
5938 {
5939 RETURN_EXPR
5940 }
5941 #[inline]
5942 fn can_cast(kind: SyntaxKind) -> bool { kind == RETURN_EXPR }
5943 #[inline]
5944 fn cast(syntax: SyntaxNode) -> Option<Self> {
5945 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
5946 }
5947 #[inline]
5948 fn syntax(&self) -> &SyntaxNode { &self.syntax }
5949}
5950impl hash::Hash for ReturnExpr {
5951 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
5952}
5953impl Eq for ReturnExpr {}
5954impl PartialEq for ReturnExpr {
5955 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
5956}
5957impl Clone for ReturnExpr {
5958 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
5959}
5960impl fmt::Debug for ReturnExpr {
5961 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
5962 f.debug_struct("ReturnExpr").field("syntax", &self.syntax).finish()
5963 }
5964}
5965impl AstNode for ReturnTypeSyntax {
5966 #[inline]
5967 fn kind() -> SyntaxKind
5968 where
5969 Self: Sized,
5970 {
5971 RETURN_TYPE_SYNTAX
5972 }
5973 #[inline]
5974 fn can_cast(kind: SyntaxKind) -> bool { kind == RETURN_TYPE_SYNTAX }
5975 #[inline]
5976 fn cast(syntax: SyntaxNode) -> Option<Self> {
5977 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
5978 }
5979 #[inline]
5980 fn syntax(&self) -> &SyntaxNode { &self.syntax }
5981}
5982impl hash::Hash for ReturnTypeSyntax {
5983 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
5984}
5985impl Eq for ReturnTypeSyntax {}
5986impl PartialEq for ReturnTypeSyntax {
5987 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
5988}
5989impl Clone for ReturnTypeSyntax {
5990 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
5991}
5992impl fmt::Debug for ReturnTypeSyntax {
5993 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
5994 f.debug_struct("ReturnTypeSyntax").field("syntax", &self.syntax).finish()
5995 }
5996}
5997impl AstNode for SelfParam {
5998 #[inline]
5999 fn kind() -> SyntaxKind
6000 where
6001 Self: Sized,
6002 {
6003 SELF_PARAM
6004 }
6005 #[inline]
6006 fn can_cast(kind: SyntaxKind) -> bool { kind == SELF_PARAM }
6007 #[inline]
6008 fn cast(syntax: SyntaxNode) -> Option<Self> {
6009 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
6010 }
6011 #[inline]
6012 fn syntax(&self) -> &SyntaxNode { &self.syntax }
6013}
6014impl hash::Hash for SelfParam {
6015 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
6016}
6017impl Eq for SelfParam {}
6018impl PartialEq for SelfParam {
6019 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
6020}
6021impl Clone for SelfParam {
6022 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
6023}
6024impl fmt::Debug for SelfParam {
6025 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
6026 f.debug_struct("SelfParam").field("syntax", &self.syntax).finish()
6027 }
6028}
6029impl AstNode for SlicePat {
6030 #[inline]
6031 fn kind() -> SyntaxKind
6032 where
6033 Self: Sized,
6034 {
6035 SLICE_PAT
6036 }
6037 #[inline]
6038 fn can_cast(kind: SyntaxKind) -> bool { kind == SLICE_PAT }
6039 #[inline]
6040 fn cast(syntax: SyntaxNode) -> Option<Self> {
6041 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
6042 }
6043 #[inline]
6044 fn syntax(&self) -> &SyntaxNode { &self.syntax }
6045}
6046impl hash::Hash for SlicePat {
6047 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
6048}
6049impl Eq for SlicePat {}
6050impl PartialEq for SlicePat {
6051 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
6052}
6053impl Clone for SlicePat {
6054 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
6055}
6056impl fmt::Debug for SlicePat {
6057 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
6058 f.debug_struct("SlicePat").field("syntax", &self.syntax).finish()
6059 }
6060}
6061impl AstNode for SliceType {
6062 #[inline]
6063 fn kind() -> SyntaxKind
6064 where
6065 Self: Sized,
6066 {
6067 SLICE_TYPE
6068 }
6069 #[inline]
6070 fn can_cast(kind: SyntaxKind) -> bool { kind == SLICE_TYPE }
6071 #[inline]
6072 fn cast(syntax: SyntaxNode) -> Option<Self> {
6073 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
6074 }
6075 #[inline]
6076 fn syntax(&self) -> &SyntaxNode { &self.syntax }
6077}
6078impl hash::Hash for SliceType {
6079 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
6080}
6081impl Eq for SliceType {}
6082impl PartialEq for SliceType {
6083 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
6084}
6085impl Clone for SliceType {
6086 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
6087}
6088impl fmt::Debug for SliceType {
6089 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
6090 f.debug_struct("SliceType").field("syntax", &self.syntax).finish()
6091 }
6092}
6093impl AstNode for SourceFile {
6094 #[inline]
6095 fn kind() -> SyntaxKind
6096 where
6097 Self: Sized,
6098 {
6099 SOURCE_FILE
6100 }
6101 #[inline]
6102 fn can_cast(kind: SyntaxKind) -> bool { kind == SOURCE_FILE }
6103 #[inline]
6104 fn cast(syntax: SyntaxNode) -> Option<Self> {
6105 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
6106 }
6107 #[inline]
6108 fn syntax(&self) -> &SyntaxNode { &self.syntax }
6109}
6110impl hash::Hash for SourceFile {
6111 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
6112}
6113impl Eq for SourceFile {}
6114impl PartialEq for SourceFile {
6115 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
6116}
6117impl Clone for SourceFile {
6118 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
6119}
6120impl fmt::Debug for SourceFile {
6121 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
6122 f.debug_struct("SourceFile").field("syntax", &self.syntax).finish()
6123 }
6124}
6125impl AstNode for Static {
6126 #[inline]
6127 fn kind() -> SyntaxKind
6128 where
6129 Self: Sized,
6130 {
6131 STATIC
6132 }
6133 #[inline]
6134 fn can_cast(kind: SyntaxKind) -> bool { kind == STATIC }
6135 #[inline]
6136 fn cast(syntax: SyntaxNode) -> Option<Self> {
6137 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
6138 }
6139 #[inline]
6140 fn syntax(&self) -> &SyntaxNode { &self.syntax }
6141}
6142impl hash::Hash for Static {
6143 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
6144}
6145impl Eq for Static {}
6146impl PartialEq for Static {
6147 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
6148}
6149impl Clone for Static {
6150 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
6151}
6152impl fmt::Debug for Static {
6153 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
6154 f.debug_struct("Static").field("syntax", &self.syntax).finish()
6155 }
6156}
6157impl AstNode for StmtList {
6158 #[inline]
6159 fn kind() -> SyntaxKind
6160 where
6161 Self: Sized,
6162 {
6163 STMT_LIST
6164 }
6165 #[inline]
6166 fn can_cast(kind: SyntaxKind) -> bool { kind == STMT_LIST }
6167 #[inline]
6168 fn cast(syntax: SyntaxNode) -> Option<Self> {
6169 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
6170 }
6171 #[inline]
6172 fn syntax(&self) -> &SyntaxNode { &self.syntax }
6173}
6174impl hash::Hash for StmtList {
6175 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
6176}
6177impl Eq for StmtList {}
6178impl PartialEq for StmtList {
6179 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
6180}
6181impl Clone for StmtList {
6182 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
6183}
6184impl fmt::Debug for StmtList {
6185 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
6186 f.debug_struct("StmtList").field("syntax", &self.syntax).finish()
6187 }
6188}
6189impl AstNode for Struct {
6190 #[inline]
6191 fn kind() -> SyntaxKind
6192 where
6193 Self: Sized,
6194 {
6195 STRUCT
6196 }
6197 #[inline]
6198 fn can_cast(kind: SyntaxKind) -> bool { kind == STRUCT }
6199 #[inline]
6200 fn cast(syntax: SyntaxNode) -> Option<Self> {
6201 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
6202 }
6203 #[inline]
6204 fn syntax(&self) -> &SyntaxNode { &self.syntax }
6205}
6206impl hash::Hash for Struct {
6207 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
6208}
6209impl Eq for Struct {}
6210impl PartialEq for Struct {
6211 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
6212}
6213impl Clone for Struct {
6214 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
6215}
6216impl fmt::Debug for Struct {
6217 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
6218 f.debug_struct("Struct").field("syntax", &self.syntax).finish()
6219 }
6220}
6221impl AstNode for TokenTree {
6222 #[inline]
6223 fn kind() -> SyntaxKind
6224 where
6225 Self: Sized,
6226 {
6227 TOKEN_TREE
6228 }
6229 #[inline]
6230 fn can_cast(kind: SyntaxKind) -> bool { kind == TOKEN_TREE }
6231 #[inline]
6232 fn cast(syntax: SyntaxNode) -> Option<Self> {
6233 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
6234 }
6235 #[inline]
6236 fn syntax(&self) -> &SyntaxNode { &self.syntax }
6237}
6238impl hash::Hash for TokenTree {
6239 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
6240}
6241impl Eq for TokenTree {}
6242impl PartialEq for TokenTree {
6243 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
6244}
6245impl Clone for TokenTree {
6246 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
6247}
6248impl fmt::Debug for TokenTree {
6249 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
6250 f.debug_struct("TokenTree").field("syntax", &self.syntax).finish()
6251 }
6252}
6253impl AstNode for Trait {
6254 #[inline]
6255 fn kind() -> SyntaxKind
6256 where
6257 Self: Sized,
6258 {
6259 TRAIT
6260 }
6261 #[inline]
6262 fn can_cast(kind: SyntaxKind) -> bool { kind == TRAIT }
6263 #[inline]
6264 fn cast(syntax: SyntaxNode) -> Option<Self> {
6265 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
6266 }
6267 #[inline]
6268 fn syntax(&self) -> &SyntaxNode { &self.syntax }
6269}
6270impl hash::Hash for Trait {
6271 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
6272}
6273impl Eq for Trait {}
6274impl PartialEq for Trait {
6275 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
6276}
6277impl Clone for Trait {
6278 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
6279}
6280impl fmt::Debug for Trait {
6281 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
6282 f.debug_struct("Trait").field("syntax", &self.syntax).finish()
6283 }
6284}
6285impl AstNode for TryExpr {
6286 #[inline]
6287 fn kind() -> SyntaxKind
6288 where
6289 Self: Sized,
6290 {
6291 TRY_EXPR
6292 }
6293 #[inline]
6294 fn can_cast(kind: SyntaxKind) -> bool { kind == TRY_EXPR }
6295 #[inline]
6296 fn cast(syntax: SyntaxNode) -> Option<Self> {
6297 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
6298 }
6299 #[inline]
6300 fn syntax(&self) -> &SyntaxNode { &self.syntax }
6301}
6302impl hash::Hash for TryExpr {
6303 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
6304}
6305impl Eq for TryExpr {}
6306impl PartialEq for TryExpr {
6307 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
6308}
6309impl Clone for TryExpr {
6310 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
6311}
6312impl fmt::Debug for TryExpr {
6313 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
6314 f.debug_struct("TryExpr").field("syntax", &self.syntax).finish()
6315 }
6316}
6317impl AstNode for TupleExpr {
6318 #[inline]
6319 fn kind() -> SyntaxKind
6320 where
6321 Self: Sized,
6322 {
6323 TUPLE_EXPR
6324 }
6325 #[inline]
6326 fn can_cast(kind: SyntaxKind) -> bool { kind == TUPLE_EXPR }
6327 #[inline]
6328 fn cast(syntax: SyntaxNode) -> Option<Self> {
6329 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
6330 }
6331 #[inline]
6332 fn syntax(&self) -> &SyntaxNode { &self.syntax }
6333}
6334impl hash::Hash for TupleExpr {
6335 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
6336}
6337impl Eq for TupleExpr {}
6338impl PartialEq for TupleExpr {
6339 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
6340}
6341impl Clone for TupleExpr {
6342 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
6343}
6344impl fmt::Debug for TupleExpr {
6345 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
6346 f.debug_struct("TupleExpr").field("syntax", &self.syntax).finish()
6347 }
6348}
6349impl AstNode for TupleField {
6350 #[inline]
6351 fn kind() -> SyntaxKind
6352 where
6353 Self: Sized,
6354 {
6355 TUPLE_FIELD
6356 }
6357 #[inline]
6358 fn can_cast(kind: SyntaxKind) -> bool { kind == TUPLE_FIELD }
6359 #[inline]
6360 fn cast(syntax: SyntaxNode) -> Option<Self> {
6361 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
6362 }
6363 #[inline]
6364 fn syntax(&self) -> &SyntaxNode { &self.syntax }
6365}
6366impl hash::Hash for TupleField {
6367 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
6368}
6369impl Eq for TupleField {}
6370impl PartialEq for TupleField {
6371 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
6372}
6373impl Clone for TupleField {
6374 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
6375}
6376impl fmt::Debug for TupleField {
6377 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
6378 f.debug_struct("TupleField").field("syntax", &self.syntax).finish()
6379 }
6380}
6381impl AstNode for TupleFieldList {
6382 #[inline]
6383 fn kind() -> SyntaxKind
6384 where
6385 Self: Sized,
6386 {
6387 TUPLE_FIELD_LIST
6388 }
6389 #[inline]
6390 fn can_cast(kind: SyntaxKind) -> bool { kind == TUPLE_FIELD_LIST }
6391 #[inline]
6392 fn cast(syntax: SyntaxNode) -> Option<Self> {
6393 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
6394 }
6395 #[inline]
6396 fn syntax(&self) -> &SyntaxNode { &self.syntax }
6397}
6398impl hash::Hash for TupleFieldList {
6399 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
6400}
6401impl Eq for TupleFieldList {}
6402impl PartialEq for TupleFieldList {
6403 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
6404}
6405impl Clone for TupleFieldList {
6406 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
6407}
6408impl fmt::Debug for TupleFieldList {
6409 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
6410 f.debug_struct("TupleFieldList").field("syntax", &self.syntax).finish()
6411 }
6412}
6413impl AstNode for TuplePat {
6414 #[inline]
6415 fn kind() -> SyntaxKind
6416 where
6417 Self: Sized,
6418 {
6419 TUPLE_PAT
6420 }
6421 #[inline]
6422 fn can_cast(kind: SyntaxKind) -> bool { kind == TUPLE_PAT }
6423 #[inline]
6424 fn cast(syntax: SyntaxNode) -> Option<Self> {
6425 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
6426 }
6427 #[inline]
6428 fn syntax(&self) -> &SyntaxNode { &self.syntax }
6429}
6430impl hash::Hash for TuplePat {
6431 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
6432}
6433impl Eq for TuplePat {}
6434impl PartialEq for TuplePat {
6435 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
6436}
6437impl Clone for TuplePat {
6438 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
6439}
6440impl fmt::Debug for TuplePat {
6441 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
6442 f.debug_struct("TuplePat").field("syntax", &self.syntax).finish()
6443 }
6444}
6445impl AstNode for TupleStructPat {
6446 #[inline]
6447 fn kind() -> SyntaxKind
6448 where
6449 Self: Sized,
6450 {
6451 TUPLE_STRUCT_PAT
6452 }
6453 #[inline]
6454 fn can_cast(kind: SyntaxKind) -> bool { kind == TUPLE_STRUCT_PAT }
6455 #[inline]
6456 fn cast(syntax: SyntaxNode) -> Option<Self> {
6457 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
6458 }
6459 #[inline]
6460 fn syntax(&self) -> &SyntaxNode { &self.syntax }
6461}
6462impl hash::Hash for TupleStructPat {
6463 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
6464}
6465impl Eq for TupleStructPat {}
6466impl PartialEq for TupleStructPat {
6467 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
6468}
6469impl Clone for TupleStructPat {
6470 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
6471}
6472impl fmt::Debug for TupleStructPat {
6473 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
6474 f.debug_struct("TupleStructPat").field("syntax", &self.syntax).finish()
6475 }
6476}
6477impl AstNode for TupleType {
6478 #[inline]
6479 fn kind() -> SyntaxKind
6480 where
6481 Self: Sized,
6482 {
6483 TUPLE_TYPE
6484 }
6485 #[inline]
6486 fn can_cast(kind: SyntaxKind) -> bool { kind == TUPLE_TYPE }
6487 #[inline]
6488 fn cast(syntax: SyntaxNode) -> Option<Self> {
6489 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
6490 }
6491 #[inline]
6492 fn syntax(&self) -> &SyntaxNode { &self.syntax }
6493}
6494impl hash::Hash for TupleType {
6495 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
6496}
6497impl Eq for TupleType {}
6498impl PartialEq for TupleType {
6499 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
6500}
6501impl Clone for TupleType {
6502 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
6503}
6504impl fmt::Debug for TupleType {
6505 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
6506 f.debug_struct("TupleType").field("syntax", &self.syntax).finish()
6507 }
6508}
6509impl AstNode for TypeAlias {
6510 #[inline]
6511 fn kind() -> SyntaxKind
6512 where
6513 Self: Sized,
6514 {
6515 TYPE_ALIAS
6516 }
6517 #[inline]
6518 fn can_cast(kind: SyntaxKind) -> bool { kind == TYPE_ALIAS }
6519 #[inline]
6520 fn cast(syntax: SyntaxNode) -> Option<Self> {
6521 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
6522 }
6523 #[inline]
6524 fn syntax(&self) -> &SyntaxNode { &self.syntax }
6525}
6526impl hash::Hash for TypeAlias {
6527 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
6528}
6529impl Eq for TypeAlias {}
6530impl PartialEq for TypeAlias {
6531 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
6532}
6533impl Clone for TypeAlias {
6534 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
6535}
6536impl fmt::Debug for TypeAlias {
6537 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
6538 f.debug_struct("TypeAlias").field("syntax", &self.syntax).finish()
6539 }
6540}
6541impl AstNode for TypeAnchor {
6542 #[inline]
6543 fn kind() -> SyntaxKind
6544 where
6545 Self: Sized,
6546 {
6547 TYPE_ANCHOR
6548 }
6549 #[inline]
6550 fn can_cast(kind: SyntaxKind) -> bool { kind == TYPE_ANCHOR }
6551 #[inline]
6552 fn cast(syntax: SyntaxNode) -> Option<Self> {
6553 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
6554 }
6555 #[inline]
6556 fn syntax(&self) -> &SyntaxNode { &self.syntax }
6557}
6558impl hash::Hash for TypeAnchor {
6559 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
6560}
6561impl Eq for TypeAnchor {}
6562impl PartialEq for TypeAnchor {
6563 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
6564}
6565impl Clone for TypeAnchor {
6566 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
6567}
6568impl fmt::Debug for TypeAnchor {
6569 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
6570 f.debug_struct("TypeAnchor").field("syntax", &self.syntax).finish()
6571 }
6572}
6573impl AstNode for TypeArg {
6574 #[inline]
6575 fn kind() -> SyntaxKind
6576 where
6577 Self: Sized,
6578 {
6579 TYPE_ARG
6580 }
6581 #[inline]
6582 fn can_cast(kind: SyntaxKind) -> bool { kind == TYPE_ARG }
6583 #[inline]
6584 fn cast(syntax: SyntaxNode) -> Option<Self> {
6585 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
6586 }
6587 #[inline]
6588 fn syntax(&self) -> &SyntaxNode { &self.syntax }
6589}
6590impl hash::Hash for TypeArg {
6591 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
6592}
6593impl Eq for TypeArg {}
6594impl PartialEq for TypeArg {
6595 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
6596}
6597impl Clone for TypeArg {
6598 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
6599}
6600impl fmt::Debug for TypeArg {
6601 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
6602 f.debug_struct("TypeArg").field("syntax", &self.syntax).finish()
6603 }
6604}
6605impl AstNode for TypeBound {
6606 #[inline]
6607 fn kind() -> SyntaxKind
6608 where
6609 Self: Sized,
6610 {
6611 TYPE_BOUND
6612 }
6613 #[inline]
6614 fn can_cast(kind: SyntaxKind) -> bool { kind == TYPE_BOUND }
6615 #[inline]
6616 fn cast(syntax: SyntaxNode) -> Option<Self> {
6617 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
6618 }
6619 #[inline]
6620 fn syntax(&self) -> &SyntaxNode { &self.syntax }
6621}
6622impl hash::Hash for TypeBound {
6623 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
6624}
6625impl Eq for TypeBound {}
6626impl PartialEq for TypeBound {
6627 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
6628}
6629impl Clone for TypeBound {
6630 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
6631}
6632impl fmt::Debug for TypeBound {
6633 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
6634 f.debug_struct("TypeBound").field("syntax", &self.syntax).finish()
6635 }
6636}
6637impl AstNode for TypeBoundList {
6638 #[inline]
6639 fn kind() -> SyntaxKind
6640 where
6641 Self: Sized,
6642 {
6643 TYPE_BOUND_LIST
6644 }
6645 #[inline]
6646 fn can_cast(kind: SyntaxKind) -> bool { kind == TYPE_BOUND_LIST }
6647 #[inline]
6648 fn cast(syntax: SyntaxNode) -> Option<Self> {
6649 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
6650 }
6651 #[inline]
6652 fn syntax(&self) -> &SyntaxNode { &self.syntax }
6653}
6654impl hash::Hash for TypeBoundList {
6655 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
6656}
6657impl Eq for TypeBoundList {}
6658impl PartialEq for TypeBoundList {
6659 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
6660}
6661impl Clone for TypeBoundList {
6662 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
6663}
6664impl fmt::Debug for TypeBoundList {
6665 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
6666 f.debug_struct("TypeBoundList").field("syntax", &self.syntax).finish()
6667 }
6668}
6669impl AstNode for TypeParam {
6670 #[inline]
6671 fn kind() -> SyntaxKind
6672 where
6673 Self: Sized,
6674 {
6675 TYPE_PARAM
6676 }
6677 #[inline]
6678 fn can_cast(kind: SyntaxKind) -> bool { kind == TYPE_PARAM }
6679 #[inline]
6680 fn cast(syntax: SyntaxNode) -> Option<Self> {
6681 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
6682 }
6683 #[inline]
6684 fn syntax(&self) -> &SyntaxNode { &self.syntax }
6685}
6686impl hash::Hash for TypeParam {
6687 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
6688}
6689impl Eq for TypeParam {}
6690impl PartialEq for TypeParam {
6691 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
6692}
6693impl Clone for TypeParam {
6694 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
6695}
6696impl fmt::Debug for TypeParam {
6697 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
6698 f.debug_struct("TypeParam").field("syntax", &self.syntax).finish()
6699 }
6700}
6701impl AstNode for UnderscoreExpr {
6702 #[inline]
6703 fn kind() -> SyntaxKind
6704 where
6705 Self: Sized,
6706 {
6707 UNDERSCORE_EXPR
6708 }
6709 #[inline]
6710 fn can_cast(kind: SyntaxKind) -> bool { kind == UNDERSCORE_EXPR }
6711 #[inline]
6712 fn cast(syntax: SyntaxNode) -> Option<Self> {
6713 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
6714 }
6715 #[inline]
6716 fn syntax(&self) -> &SyntaxNode { &self.syntax }
6717}
6718impl hash::Hash for UnderscoreExpr {
6719 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
6720}
6721impl Eq for UnderscoreExpr {}
6722impl PartialEq for UnderscoreExpr {
6723 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
6724}
6725impl Clone for UnderscoreExpr {
6726 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
6727}
6728impl fmt::Debug for UnderscoreExpr {
6729 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
6730 f.debug_struct("UnderscoreExpr").field("syntax", &self.syntax).finish()
6731 }
6732}
6733impl AstNode for Union {
6734 #[inline]
6735 fn kind() -> SyntaxKind
6736 where
6737 Self: Sized,
6738 {
6739 UNION
6740 }
6741 #[inline]
6742 fn can_cast(kind: SyntaxKind) -> bool { kind == UNION }
6743 #[inline]
6744 fn cast(syntax: SyntaxNode) -> Option<Self> {
6745 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
6746 }
6747 #[inline]
6748 fn syntax(&self) -> &SyntaxNode { &self.syntax }
6749}
6750impl hash::Hash for Union {
6751 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
6752}
6753impl Eq for Union {}
6754impl PartialEq for Union {
6755 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
6756}
6757impl Clone for Union {
6758 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
6759}
6760impl fmt::Debug for Union {
6761 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
6762 f.debug_struct("Union").field("syntax", &self.syntax).finish()
6763 }
6764}
6765impl AstNode for Use {
6766 #[inline]
6767 fn kind() -> SyntaxKind
6768 where
6769 Self: Sized,
6770 {
6771 USE
6772 }
6773 #[inline]
6774 fn can_cast(kind: SyntaxKind) -> bool { kind == USE }
6775 #[inline]
6776 fn cast(syntax: SyntaxNode) -> Option<Self> {
6777 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
6778 }
6779 #[inline]
6780 fn syntax(&self) -> &SyntaxNode { &self.syntax }
6781}
6782impl hash::Hash for Use {
6783 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
6784}
6785impl Eq for Use {}
6786impl PartialEq for Use {
6787 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
6788}
6789impl Clone for Use {
6790 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
6791}
6792impl fmt::Debug for Use {
6793 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
6794 f.debug_struct("Use").field("syntax", &self.syntax).finish()
6795 }
6796}
6797impl AstNode for UseBoundGenericArgs {
6798 #[inline]
6799 fn kind() -> SyntaxKind
6800 where
6801 Self: Sized,
6802 {
6803 USE_BOUND_GENERIC_ARGS
6804 }
6805 #[inline]
6806 fn can_cast(kind: SyntaxKind) -> bool { kind == USE_BOUND_GENERIC_ARGS }
6807 #[inline]
6808 fn cast(syntax: SyntaxNode) -> Option<Self> {
6809 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
6810 }
6811 #[inline]
6812 fn syntax(&self) -> &SyntaxNode { &self.syntax }
6813}
6814impl hash::Hash for UseBoundGenericArgs {
6815 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
6816}
6817impl Eq for UseBoundGenericArgs {}
6818impl PartialEq for UseBoundGenericArgs {
6819 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
6820}
6821impl Clone for UseBoundGenericArgs {
6822 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
6823}
6824impl fmt::Debug for UseBoundGenericArgs {
6825 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
6826 f.debug_struct("UseBoundGenericArgs").field("syntax", &self.syntax).finish()
6827 }
6828}
6829impl AstNode for UseTree {
6830 #[inline]
6831 fn kind() -> SyntaxKind
6832 where
6833 Self: Sized,
6834 {
6835 USE_TREE
6836 }
6837 #[inline]
6838 fn can_cast(kind: SyntaxKind) -> bool { kind == USE_TREE }
6839 #[inline]
6840 fn cast(syntax: SyntaxNode) -> Option<Self> {
6841 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
6842 }
6843 #[inline]
6844 fn syntax(&self) -> &SyntaxNode { &self.syntax }
6845}
6846impl hash::Hash for UseTree {
6847 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
6848}
6849impl Eq for UseTree {}
6850impl PartialEq for UseTree {
6851 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
6852}
6853impl Clone for UseTree {
6854 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
6855}
6856impl fmt::Debug for UseTree {
6857 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
6858 f.debug_struct("UseTree").field("syntax", &self.syntax).finish()
6859 }
6860}
6861impl AstNode for UseTreeList {
6862 #[inline]
6863 fn kind() -> SyntaxKind
6864 where
6865 Self: Sized,
6866 {
6867 USE_TREE_LIST
6868 }
6869 #[inline]
6870 fn can_cast(kind: SyntaxKind) -> bool { kind == USE_TREE_LIST }
6871 #[inline]
6872 fn cast(syntax: SyntaxNode) -> Option<Self> {
6873 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
6874 }
6875 #[inline]
6876 fn syntax(&self) -> &SyntaxNode { &self.syntax }
6877}
6878impl hash::Hash for UseTreeList {
6879 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
6880}
6881impl Eq for UseTreeList {}
6882impl PartialEq for UseTreeList {
6883 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
6884}
6885impl Clone for UseTreeList {
6886 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
6887}
6888impl fmt::Debug for UseTreeList {
6889 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
6890 f.debug_struct("UseTreeList").field("syntax", &self.syntax).finish()
6891 }
6892}
6893impl AstNode for Variant {
6894 #[inline]
6895 fn kind() -> SyntaxKind
6896 where
6897 Self: Sized,
6898 {
6899 VARIANT
6900 }
6901 #[inline]
6902 fn can_cast(kind: SyntaxKind) -> bool { kind == VARIANT }
6903 #[inline]
6904 fn cast(syntax: SyntaxNode) -> Option<Self> {
6905 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
6906 }
6907 #[inline]
6908 fn syntax(&self) -> &SyntaxNode { &self.syntax }
6909}
6910impl hash::Hash for Variant {
6911 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
6912}
6913impl Eq for Variant {}
6914impl PartialEq for Variant {
6915 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
6916}
6917impl Clone for Variant {
6918 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
6919}
6920impl fmt::Debug for Variant {
6921 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
6922 f.debug_struct("Variant").field("syntax", &self.syntax).finish()
6923 }
6924}
6925impl AstNode for VariantList {
6926 #[inline]
6927 fn kind() -> SyntaxKind
6928 where
6929 Self: Sized,
6930 {
6931 VARIANT_LIST
6932 }
6933 #[inline]
6934 fn can_cast(kind: SyntaxKind) -> bool { kind == VARIANT_LIST }
6935 #[inline]
6936 fn cast(syntax: SyntaxNode) -> Option<Self> {
6937 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
6938 }
6939 #[inline]
6940 fn syntax(&self) -> &SyntaxNode { &self.syntax }
6941}
6942impl hash::Hash for VariantList {
6943 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
6944}
6945impl Eq for VariantList {}
6946impl PartialEq for VariantList {
6947 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
6948}
6949impl Clone for VariantList {
6950 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
6951}
6952impl fmt::Debug for VariantList {
6953 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
6954 f.debug_struct("VariantList").field("syntax", &self.syntax).finish()
6955 }
6956}
6957impl AstNode for Visibility {
6958 #[inline]
6959 fn kind() -> SyntaxKind
6960 where
6961 Self: Sized,
6962 {
6963 VISIBILITY
6964 }
6965 #[inline]
6966 fn can_cast(kind: SyntaxKind) -> bool { kind == VISIBILITY }
6967 #[inline]
6968 fn cast(syntax: SyntaxNode) -> Option<Self> {
6969 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
6970 }
6971 #[inline]
6972 fn syntax(&self) -> &SyntaxNode { &self.syntax }
6973}
6974impl hash::Hash for Visibility {
6975 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
6976}
6977impl Eq for Visibility {}
6978impl PartialEq for Visibility {
6979 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
6980}
6981impl Clone for Visibility {
6982 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
6983}
6984impl fmt::Debug for Visibility {
6985 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
6986 f.debug_struct("Visibility").field("syntax", &self.syntax).finish()
6987 }
6988}
6989impl AstNode for WhereClause {
6990 #[inline]
6991 fn kind() -> SyntaxKind
6992 where
6993 Self: Sized,
6994 {
6995 WHERE_CLAUSE
6996 }
6997 #[inline]
6998 fn can_cast(kind: SyntaxKind) -> bool { kind == WHERE_CLAUSE }
6999 #[inline]
7000 fn cast(syntax: SyntaxNode) -> Option<Self> {
7001 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
7002 }
7003 #[inline]
7004 fn syntax(&self) -> &SyntaxNode { &self.syntax }
7005}
7006impl hash::Hash for WhereClause {
7007 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
7008}
7009impl Eq for WhereClause {}
7010impl PartialEq for WhereClause {
7011 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
7012}
7013impl Clone for WhereClause {
7014 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
7015}
7016impl fmt::Debug for WhereClause {
7017 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
7018 f.debug_struct("WhereClause").field("syntax", &self.syntax).finish()
7019 }
7020}
7021impl AstNode for WherePred {
7022 #[inline]
7023 fn kind() -> SyntaxKind
7024 where
7025 Self: Sized,
7026 {
7027 WHERE_PRED
7028 }
7029 #[inline]
7030 fn can_cast(kind: SyntaxKind) -> bool { kind == WHERE_PRED }
7031 #[inline]
7032 fn cast(syntax: SyntaxNode) -> Option<Self> {
7033 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
7034 }
7035 #[inline]
7036 fn syntax(&self) -> &SyntaxNode { &self.syntax }
7037}
7038impl hash::Hash for WherePred {
7039 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
7040}
7041impl Eq for WherePred {}
7042impl PartialEq for WherePred {
7043 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
7044}
7045impl Clone for WherePred {
7046 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
7047}
7048impl fmt::Debug for WherePred {
7049 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
7050 f.debug_struct("WherePred").field("syntax", &self.syntax).finish()
7051 }
7052}
7053impl AstNode for WhileExpr {
7054 #[inline]
7055 fn kind() -> SyntaxKind
7056 where
7057 Self: Sized,
7058 {
7059 WHILE_EXPR
7060 }
7061 #[inline]
7062 fn can_cast(kind: SyntaxKind) -> bool { kind == WHILE_EXPR }
7063 #[inline]
7064 fn cast(syntax: SyntaxNode) -> Option<Self> {
7065 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
7066 }
7067 #[inline]
7068 fn syntax(&self) -> &SyntaxNode { &self.syntax }
7069}
7070impl hash::Hash for WhileExpr {
7071 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
7072}
7073impl Eq for WhileExpr {}
7074impl PartialEq for WhileExpr {
7075 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
7076}
7077impl Clone for WhileExpr {
7078 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
7079}
7080impl fmt::Debug for WhileExpr {
7081 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
7082 f.debug_struct("WhileExpr").field("syntax", &self.syntax).finish()
7083 }
7084}
7085impl AstNode for WildcardPat {
7086 #[inline]
7087 fn kind() -> SyntaxKind
7088 where
7089 Self: Sized,
7090 {
7091 WILDCARD_PAT
7092 }
7093 #[inline]
7094 fn can_cast(kind: SyntaxKind) -> bool { kind == WILDCARD_PAT }
7095 #[inline]
7096 fn cast(syntax: SyntaxNode) -> Option<Self> {
7097 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
7098 }
7099 #[inline]
7100 fn syntax(&self) -> &SyntaxNode { &self.syntax }
7101}
7102impl hash::Hash for WildcardPat {
7103 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
7104}
7105impl Eq for WildcardPat {}
7106impl PartialEq for WildcardPat {
7107 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
7108}
7109impl Clone for WildcardPat {
7110 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
7111}
7112impl fmt::Debug for WildcardPat {
7113 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
7114 f.debug_struct("WildcardPat").field("syntax", &self.syntax).finish()
7115 }
7116}
7117impl AstNode for YeetExpr {
7118 #[inline]
7119 fn kind() -> SyntaxKind
7120 where
7121 Self: Sized,
7122 {
7123 YEET_EXPR
7124 }
7125 #[inline]
7126 fn can_cast(kind: SyntaxKind) -> bool { kind == YEET_EXPR }
7127 #[inline]
7128 fn cast(syntax: SyntaxNode) -> Option<Self> {
7129 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
7130 }
7131 #[inline]
7132 fn syntax(&self) -> &SyntaxNode { &self.syntax }
7133}
7134impl hash::Hash for YeetExpr {
7135 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
7136}
7137impl Eq for YeetExpr {}
7138impl PartialEq for YeetExpr {
7139 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
7140}
7141impl Clone for YeetExpr {
7142 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
7143}
7144impl fmt::Debug for YeetExpr {
7145 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
7146 f.debug_struct("YeetExpr").field("syntax", &self.syntax).finish()
7147 }
7148}
7149impl AstNode for YieldExpr {
7150 #[inline]
7151 fn kind() -> SyntaxKind
7152 where
7153 Self: Sized,
7154 {
7155 YIELD_EXPR
7156 }
7157 #[inline]
7158 fn can_cast(kind: SyntaxKind) -> bool { kind == YIELD_EXPR }
7159 #[inline]
7160 fn cast(syntax: SyntaxNode) -> Option<Self> {
7161 if Self::can_cast(syntax.kind()) { Some(Self { syntax }) } else { None }
7162 }
7163 #[inline]
7164 fn syntax(&self) -> &SyntaxNode { &self.syntax }
7165}
7166impl hash::Hash for YieldExpr {
7167 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
7168}
7169impl Eq for YieldExpr {}
7170impl PartialEq for YieldExpr {
7171 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
7172}
7173impl Clone for YieldExpr {
7174 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
7175}
7176impl fmt::Debug for YieldExpr {
7177 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
7178 f.debug_struct("YieldExpr").field("syntax", &self.syntax).finish()
7179 }
7180}
7181impl From<Enum> for Adt {
7182 #[inline]
7183 fn from(node: Enum) -> Adt { Adt::Enum(node) }
7184}
7185impl From<Struct> for Adt {
7186 #[inline]
7187 fn from(node: Struct) -> Adt { Adt::Struct(node) }
7188}
7189impl From<Union> for Adt {
7190 #[inline]
7191 fn from(node: Union) -> Adt { Adt::Union(node) }
7192}
7193impl AstNode for Adt {
7194 #[inline]
7195 fn can_cast(kind: SyntaxKind) -> bool { matches!(kind, ENUM | STRUCT | UNION) }
7196 #[inline]
7197 fn cast(syntax: SyntaxNode) -> Option<Self> {
7198 let res = match syntax.kind() {
7199 ENUM => Adt::Enum(Enum { syntax }),
7200 STRUCT => Adt::Struct(Struct { syntax }),
7201 UNION => Adt::Union(Union { syntax }),
7202 _ => return None,
7203 };
7204 Some(res)
7205 }
7206 #[inline]
7207 fn syntax(&self) -> &SyntaxNode {
7208 match self {
7209 Adt::Enum(it) => &it.syntax,
7210 Adt::Struct(it) => &it.syntax,
7211 Adt::Union(it) => &it.syntax,
7212 }
7213 }
7214}
7215impl From<AsmConst> for AsmOperand {
7216 #[inline]
7217 fn from(node: AsmConst) -> AsmOperand { AsmOperand::AsmConst(node) }
7218}
7219impl From<AsmLabel> for AsmOperand {
7220 #[inline]
7221 fn from(node: AsmLabel) -> AsmOperand { AsmOperand::AsmLabel(node) }
7222}
7223impl From<AsmRegOperand> for AsmOperand {
7224 #[inline]
7225 fn from(node: AsmRegOperand) -> AsmOperand { AsmOperand::AsmRegOperand(node) }
7226}
7227impl From<AsmSym> for AsmOperand {
7228 #[inline]
7229 fn from(node: AsmSym) -> AsmOperand { AsmOperand::AsmSym(node) }
7230}
7231impl AstNode for AsmOperand {
7232 #[inline]
7233 fn can_cast(kind: SyntaxKind) -> bool {
7234 matches!(kind, ASM_CONST | ASM_LABEL | ASM_REG_OPERAND | ASM_SYM)
7235 }
7236 #[inline]
7237 fn cast(syntax: SyntaxNode) -> Option<Self> {
7238 let res = match syntax.kind() {
7239 ASM_CONST => AsmOperand::AsmConst(AsmConst { syntax }),
7240 ASM_LABEL => AsmOperand::AsmLabel(AsmLabel { syntax }),
7241 ASM_REG_OPERAND => AsmOperand::AsmRegOperand(AsmRegOperand { syntax }),
7242 ASM_SYM => AsmOperand::AsmSym(AsmSym { syntax }),
7243 _ => return None,
7244 };
7245 Some(res)
7246 }
7247 #[inline]
7248 fn syntax(&self) -> &SyntaxNode {
7249 match self {
7250 AsmOperand::AsmConst(it) => &it.syntax,
7251 AsmOperand::AsmLabel(it) => &it.syntax,
7252 AsmOperand::AsmRegOperand(it) => &it.syntax,
7253 AsmOperand::AsmSym(it) => &it.syntax,
7254 }
7255 }
7256}
7257impl From<AsmClobberAbi> for AsmPiece {
7258 #[inline]
7259 fn from(node: AsmClobberAbi) -> AsmPiece { AsmPiece::AsmClobberAbi(node) }
7260}
7261impl From<AsmOperandNamed> for AsmPiece {
7262 #[inline]
7263 fn from(node: AsmOperandNamed) -> AsmPiece { AsmPiece::AsmOperandNamed(node) }
7264}
7265impl From<AsmOptions> for AsmPiece {
7266 #[inline]
7267 fn from(node: AsmOptions) -> AsmPiece { AsmPiece::AsmOptions(node) }
7268}
7269impl AstNode for AsmPiece {
7270 #[inline]
7271 fn can_cast(kind: SyntaxKind) -> bool {
7272 matches!(kind, ASM_CLOBBER_ABI | ASM_OPERAND_NAMED | ASM_OPTIONS)
7273 }
7274 #[inline]
7275 fn cast(syntax: SyntaxNode) -> Option<Self> {
7276 let res = match syntax.kind() {
7277 ASM_CLOBBER_ABI => AsmPiece::AsmClobberAbi(AsmClobberAbi { syntax }),
7278 ASM_OPERAND_NAMED => AsmPiece::AsmOperandNamed(AsmOperandNamed { syntax }),
7279 ASM_OPTIONS => AsmPiece::AsmOptions(AsmOptions { syntax }),
7280 _ => return None,
7281 };
7282 Some(res)
7283 }
7284 #[inline]
7285 fn syntax(&self) -> &SyntaxNode {
7286 match self {
7287 AsmPiece::AsmClobberAbi(it) => &it.syntax,
7288 AsmPiece::AsmOperandNamed(it) => &it.syntax,
7289 AsmPiece::AsmOptions(it) => &it.syntax,
7290 }
7291 }
7292}
7293impl From<Const> for AssocItem {
7294 #[inline]
7295 fn from(node: Const) -> AssocItem { AssocItem::Const(node) }
7296}
7297impl From<Fn> for AssocItem {
7298 #[inline]
7299 fn from(node: Fn) -> AssocItem { AssocItem::Fn(node) }
7300}
7301impl From<MacroCall> for AssocItem {
7302 #[inline]
7303 fn from(node: MacroCall) -> AssocItem { AssocItem::MacroCall(node) }
7304}
7305impl From<TypeAlias> for AssocItem {
7306 #[inline]
7307 fn from(node: TypeAlias) -> AssocItem { AssocItem::TypeAlias(node) }
7308}
7309impl AstNode for AssocItem {
7310 #[inline]
7311 fn can_cast(kind: SyntaxKind) -> bool { matches!(kind, CONST | FN | MACRO_CALL | TYPE_ALIAS) }
7312 #[inline]
7313 fn cast(syntax: SyntaxNode) -> Option<Self> {
7314 let res = match syntax.kind() {
7315 CONST => AssocItem::Const(Const { syntax }),
7316 FN => AssocItem::Fn(Fn { syntax }),
7317 MACRO_CALL => AssocItem::MacroCall(MacroCall { syntax }),
7318 TYPE_ALIAS => AssocItem::TypeAlias(TypeAlias { syntax }),
7319 _ => return None,
7320 };
7321 Some(res)
7322 }
7323 #[inline]
7324 fn syntax(&self) -> &SyntaxNode {
7325 match self {
7326 AssocItem::Const(it) => &it.syntax,
7327 AssocItem::Fn(it) => &it.syntax,
7328 AssocItem::MacroCall(it) => &it.syntax,
7329 AssocItem::TypeAlias(it) => &it.syntax,
7330 }
7331 }
7332}
7333impl From<ArrayExpr> for Expr {
7334 #[inline]
7335 fn from(node: ArrayExpr) -> Expr { Expr::ArrayExpr(node) }
7336}
7337impl From<AsmExpr> for Expr {
7338 #[inline]
7339 fn from(node: AsmExpr) -> Expr { Expr::AsmExpr(node) }
7340}
7341impl From<AwaitExpr> for Expr {
7342 #[inline]
7343 fn from(node: AwaitExpr) -> Expr { Expr::AwaitExpr(node) }
7344}
7345impl From<BecomeExpr> for Expr {
7346 #[inline]
7347 fn from(node: BecomeExpr) -> Expr { Expr::BecomeExpr(node) }
7348}
7349impl From<BinExpr> for Expr {
7350 #[inline]
7351 fn from(node: BinExpr) -> Expr { Expr::BinExpr(node) }
7352}
7353impl From<BlockExpr> for Expr {
7354 #[inline]
7355 fn from(node: BlockExpr) -> Expr { Expr::BlockExpr(node) }
7356}
7357impl From<BreakExpr> for Expr {
7358 #[inline]
7359 fn from(node: BreakExpr) -> Expr { Expr::BreakExpr(node) }
7360}
7361impl From<CallExpr> for Expr {
7362 #[inline]
7363 fn from(node: CallExpr) -> Expr { Expr::CallExpr(node) }
7364}
7365impl From<CastExpr> for Expr {
7366 #[inline]
7367 fn from(node: CastExpr) -> Expr { Expr::CastExpr(node) }
7368}
7369impl From<ClosureExpr> for Expr {
7370 #[inline]
7371 fn from(node: ClosureExpr) -> Expr { Expr::ClosureExpr(node) }
7372}
7373impl From<ContinueExpr> for Expr {
7374 #[inline]
7375 fn from(node: ContinueExpr) -> Expr { Expr::ContinueExpr(node) }
7376}
7377impl From<FieldExpr> for Expr {
7378 #[inline]
7379 fn from(node: FieldExpr) -> Expr { Expr::FieldExpr(node) }
7380}
7381impl From<ForExpr> for Expr {
7382 #[inline]
7383 fn from(node: ForExpr) -> Expr { Expr::ForExpr(node) }
7384}
7385impl From<FormatArgsExpr> for Expr {
7386 #[inline]
7387 fn from(node: FormatArgsExpr) -> Expr { Expr::FormatArgsExpr(node) }
7388}
7389impl From<IfExpr> for Expr {
7390 #[inline]
7391 fn from(node: IfExpr) -> Expr { Expr::IfExpr(node) }
7392}
7393impl From<IndexExpr> for Expr {
7394 #[inline]
7395 fn from(node: IndexExpr) -> Expr { Expr::IndexExpr(node) }
7396}
7397impl From<LetExpr> for Expr {
7398 #[inline]
7399 fn from(node: LetExpr) -> Expr { Expr::LetExpr(node) }
7400}
7401impl From<Literal> for Expr {
7402 #[inline]
7403 fn from(node: Literal) -> Expr { Expr::Literal(node) }
7404}
7405impl From<LoopExpr> for Expr {
7406 #[inline]
7407 fn from(node: LoopExpr) -> Expr { Expr::LoopExpr(node) }
7408}
7409impl From<MacroExpr> for Expr {
7410 #[inline]
7411 fn from(node: MacroExpr) -> Expr { Expr::MacroExpr(node) }
7412}
7413impl From<MatchExpr> for Expr {
7414 #[inline]
7415 fn from(node: MatchExpr) -> Expr { Expr::MatchExpr(node) }
7416}
7417impl From<MethodCallExpr> for Expr {
7418 #[inline]
7419 fn from(node: MethodCallExpr) -> Expr { Expr::MethodCallExpr(node) }
7420}
7421impl From<OffsetOfExpr> for Expr {
7422 #[inline]
7423 fn from(node: OffsetOfExpr) -> Expr { Expr::OffsetOfExpr(node) }
7424}
7425impl From<ParenExpr> for Expr {
7426 #[inline]
7427 fn from(node: ParenExpr) -> Expr { Expr::ParenExpr(node) }
7428}
7429impl From<PathExpr> for Expr {
7430 #[inline]
7431 fn from(node: PathExpr) -> Expr { Expr::PathExpr(node) }
7432}
7433impl From<PrefixExpr> for Expr {
7434 #[inline]
7435 fn from(node: PrefixExpr) -> Expr { Expr::PrefixExpr(node) }
7436}
7437impl From<RangeExpr> for Expr {
7438 #[inline]
7439 fn from(node: RangeExpr) -> Expr { Expr::RangeExpr(node) }
7440}
7441impl From<RecordExpr> for Expr {
7442 #[inline]
7443 fn from(node: RecordExpr) -> Expr { Expr::RecordExpr(node) }
7444}
7445impl From<RefExpr> for Expr {
7446 #[inline]
7447 fn from(node: RefExpr) -> Expr { Expr::RefExpr(node) }
7448}
7449impl From<ReturnExpr> for Expr {
7450 #[inline]
7451 fn from(node: ReturnExpr) -> Expr { Expr::ReturnExpr(node) }
7452}
7453impl From<TryExpr> for Expr {
7454 #[inline]
7455 fn from(node: TryExpr) -> Expr { Expr::TryExpr(node) }
7456}
7457impl From<TupleExpr> for Expr {
7458 #[inline]
7459 fn from(node: TupleExpr) -> Expr { Expr::TupleExpr(node) }
7460}
7461impl From<UnderscoreExpr> for Expr {
7462 #[inline]
7463 fn from(node: UnderscoreExpr) -> Expr { Expr::UnderscoreExpr(node) }
7464}
7465impl From<WhileExpr> for Expr {
7466 #[inline]
7467 fn from(node: WhileExpr) -> Expr { Expr::WhileExpr(node) }
7468}
7469impl From<YeetExpr> for Expr {
7470 #[inline]
7471 fn from(node: YeetExpr) -> Expr { Expr::YeetExpr(node) }
7472}
7473impl From<YieldExpr> for Expr {
7474 #[inline]
7475 fn from(node: YieldExpr) -> Expr { Expr::YieldExpr(node) }
7476}
7477impl AstNode for Expr {
7478 #[inline]
7479 fn can_cast(kind: SyntaxKind) -> bool {
7480 matches!(
7481 kind,
7482 ARRAY_EXPR
7483 | ASM_EXPR
7484 | AWAIT_EXPR
7485 | BECOME_EXPR
7486 | BIN_EXPR
7487 | BLOCK_EXPR
7488 | BREAK_EXPR
7489 | CALL_EXPR
7490 | CAST_EXPR
7491 | CLOSURE_EXPR
7492 | CONTINUE_EXPR
7493 | FIELD_EXPR
7494 | FOR_EXPR
7495 | FORMAT_ARGS_EXPR
7496 | IF_EXPR
7497 | INDEX_EXPR
7498 | LET_EXPR
7499 | LITERAL
7500 | LOOP_EXPR
7501 | MACRO_EXPR
7502 | MATCH_EXPR
7503 | METHOD_CALL_EXPR
7504 | OFFSET_OF_EXPR
7505 | PAREN_EXPR
7506 | PATH_EXPR
7507 | PREFIX_EXPR
7508 | RANGE_EXPR
7509 | RECORD_EXPR
7510 | REF_EXPR
7511 | RETURN_EXPR
7512 | TRY_EXPR
7513 | TUPLE_EXPR
7514 | UNDERSCORE_EXPR
7515 | WHILE_EXPR
7516 | YEET_EXPR
7517 | YIELD_EXPR
7518 )
7519 }
7520 #[inline]
7521 fn cast(syntax: SyntaxNode) -> Option<Self> {
7522 let res = match syntax.kind() {
7523 ARRAY_EXPR => Expr::ArrayExpr(ArrayExpr { syntax }),
7524 ASM_EXPR => Expr::AsmExpr(AsmExpr { syntax }),
7525 AWAIT_EXPR => Expr::AwaitExpr(AwaitExpr { syntax }),
7526 BECOME_EXPR => Expr::BecomeExpr(BecomeExpr { syntax }),
7527 BIN_EXPR => Expr::BinExpr(BinExpr { syntax }),
7528 BLOCK_EXPR => Expr::BlockExpr(BlockExpr { syntax }),
7529 BREAK_EXPR => Expr::BreakExpr(BreakExpr { syntax }),
7530 CALL_EXPR => Expr::CallExpr(CallExpr { syntax }),
7531 CAST_EXPR => Expr::CastExpr(CastExpr { syntax }),
7532 CLOSURE_EXPR => Expr::ClosureExpr(ClosureExpr { syntax }),
7533 CONTINUE_EXPR => Expr::ContinueExpr(ContinueExpr { syntax }),
7534 FIELD_EXPR => Expr::FieldExpr(FieldExpr { syntax }),
7535 FOR_EXPR => Expr::ForExpr(ForExpr { syntax }),
7536 FORMAT_ARGS_EXPR => Expr::FormatArgsExpr(FormatArgsExpr { syntax }),
7537 IF_EXPR => Expr::IfExpr(IfExpr { syntax }),
7538 INDEX_EXPR => Expr::IndexExpr(IndexExpr { syntax }),
7539 LET_EXPR => Expr::LetExpr(LetExpr { syntax }),
7540 LITERAL => Expr::Literal(Literal { syntax }),
7541 LOOP_EXPR => Expr::LoopExpr(LoopExpr { syntax }),
7542 MACRO_EXPR => Expr::MacroExpr(MacroExpr { syntax }),
7543 MATCH_EXPR => Expr::MatchExpr(MatchExpr { syntax }),
7544 METHOD_CALL_EXPR => Expr::MethodCallExpr(MethodCallExpr { syntax }),
7545 OFFSET_OF_EXPR => Expr::OffsetOfExpr(OffsetOfExpr { syntax }),
7546 PAREN_EXPR => Expr::ParenExpr(ParenExpr { syntax }),
7547 PATH_EXPR => Expr::PathExpr(PathExpr { syntax }),
7548 PREFIX_EXPR => Expr::PrefixExpr(PrefixExpr { syntax }),
7549 RANGE_EXPR => Expr::RangeExpr(RangeExpr { syntax }),
7550 RECORD_EXPR => Expr::RecordExpr(RecordExpr { syntax }),
7551 REF_EXPR => Expr::RefExpr(RefExpr { syntax }),
7552 RETURN_EXPR => Expr::ReturnExpr(ReturnExpr { syntax }),
7553 TRY_EXPR => Expr::TryExpr(TryExpr { syntax }),
7554 TUPLE_EXPR => Expr::TupleExpr(TupleExpr { syntax }),
7555 UNDERSCORE_EXPR => Expr::UnderscoreExpr(UnderscoreExpr { syntax }),
7556 WHILE_EXPR => Expr::WhileExpr(WhileExpr { syntax }),
7557 YEET_EXPR => Expr::YeetExpr(YeetExpr { syntax }),
7558 YIELD_EXPR => Expr::YieldExpr(YieldExpr { syntax }),
7559 _ => return None,
7560 };
7561 Some(res)
7562 }
7563 #[inline]
7564 fn syntax(&self) -> &SyntaxNode {
7565 match self {
7566 Expr::ArrayExpr(it) => &it.syntax,
7567 Expr::AsmExpr(it) => &it.syntax,
7568 Expr::AwaitExpr(it) => &it.syntax,
7569 Expr::BecomeExpr(it) => &it.syntax,
7570 Expr::BinExpr(it) => &it.syntax,
7571 Expr::BlockExpr(it) => &it.syntax,
7572 Expr::BreakExpr(it) => &it.syntax,
7573 Expr::CallExpr(it) => &it.syntax,
7574 Expr::CastExpr(it) => &it.syntax,
7575 Expr::ClosureExpr(it) => &it.syntax,
7576 Expr::ContinueExpr(it) => &it.syntax,
7577 Expr::FieldExpr(it) => &it.syntax,
7578 Expr::ForExpr(it) => &it.syntax,
7579 Expr::FormatArgsExpr(it) => &it.syntax,
7580 Expr::IfExpr(it) => &it.syntax,
7581 Expr::IndexExpr(it) => &it.syntax,
7582 Expr::LetExpr(it) => &it.syntax,
7583 Expr::Literal(it) => &it.syntax,
7584 Expr::LoopExpr(it) => &it.syntax,
7585 Expr::MacroExpr(it) => &it.syntax,
7586 Expr::MatchExpr(it) => &it.syntax,
7587 Expr::MethodCallExpr(it) => &it.syntax,
7588 Expr::OffsetOfExpr(it) => &it.syntax,
7589 Expr::ParenExpr(it) => &it.syntax,
7590 Expr::PathExpr(it) => &it.syntax,
7591 Expr::PrefixExpr(it) => &it.syntax,
7592 Expr::RangeExpr(it) => &it.syntax,
7593 Expr::RecordExpr(it) => &it.syntax,
7594 Expr::RefExpr(it) => &it.syntax,
7595 Expr::ReturnExpr(it) => &it.syntax,
7596 Expr::TryExpr(it) => &it.syntax,
7597 Expr::TupleExpr(it) => &it.syntax,
7598 Expr::UnderscoreExpr(it) => &it.syntax,
7599 Expr::WhileExpr(it) => &it.syntax,
7600 Expr::YeetExpr(it) => &it.syntax,
7601 Expr::YieldExpr(it) => &it.syntax,
7602 }
7603 }
7604}
7605impl From<Fn> for ExternItem {
7606 #[inline]
7607 fn from(node: Fn) -> ExternItem { ExternItem::Fn(node) }
7608}
7609impl From<MacroCall> for ExternItem {
7610 #[inline]
7611 fn from(node: MacroCall) -> ExternItem { ExternItem::MacroCall(node) }
7612}
7613impl From<Static> for ExternItem {
7614 #[inline]
7615 fn from(node: Static) -> ExternItem { ExternItem::Static(node) }
7616}
7617impl From<TypeAlias> for ExternItem {
7618 #[inline]
7619 fn from(node: TypeAlias) -> ExternItem { ExternItem::TypeAlias(node) }
7620}
7621impl AstNode for ExternItem {
7622 #[inline]
7623 fn can_cast(kind: SyntaxKind) -> bool { matches!(kind, FN | MACRO_CALL | STATIC | TYPE_ALIAS) }
7624 #[inline]
7625 fn cast(syntax: SyntaxNode) -> Option<Self> {
7626 let res = match syntax.kind() {
7627 FN => ExternItem::Fn(Fn { syntax }),
7628 MACRO_CALL => ExternItem::MacroCall(MacroCall { syntax }),
7629 STATIC => ExternItem::Static(Static { syntax }),
7630 TYPE_ALIAS => ExternItem::TypeAlias(TypeAlias { syntax }),
7631 _ => return None,
7632 };
7633 Some(res)
7634 }
7635 #[inline]
7636 fn syntax(&self) -> &SyntaxNode {
7637 match self {
7638 ExternItem::Fn(it) => &it.syntax,
7639 ExternItem::MacroCall(it) => &it.syntax,
7640 ExternItem::Static(it) => &it.syntax,
7641 ExternItem::TypeAlias(it) => &it.syntax,
7642 }
7643 }
7644}
7645impl From<RecordFieldList> for FieldList {
7646 #[inline]
7647 fn from(node: RecordFieldList) -> FieldList { FieldList::RecordFieldList(node) }
7648}
7649impl From<TupleFieldList> for FieldList {
7650 #[inline]
7651 fn from(node: TupleFieldList) -> FieldList { FieldList::TupleFieldList(node) }
7652}
7653impl AstNode for FieldList {
7654 #[inline]
7655 fn can_cast(kind: SyntaxKind) -> bool { matches!(kind, RECORD_FIELD_LIST | TUPLE_FIELD_LIST) }
7656 #[inline]
7657 fn cast(syntax: SyntaxNode) -> Option<Self> {
7658 let res = match syntax.kind() {
7659 RECORD_FIELD_LIST => FieldList::RecordFieldList(RecordFieldList { syntax }),
7660 TUPLE_FIELD_LIST => FieldList::TupleFieldList(TupleFieldList { syntax }),
7661 _ => return None,
7662 };
7663 Some(res)
7664 }
7665 #[inline]
7666 fn syntax(&self) -> &SyntaxNode {
7667 match self {
7668 FieldList::RecordFieldList(it) => &it.syntax,
7669 FieldList::TupleFieldList(it) => &it.syntax,
7670 }
7671 }
7672}
7673impl From<AssocTypeArg> for GenericArg {
7674 #[inline]
7675 fn from(node: AssocTypeArg) -> GenericArg { GenericArg::AssocTypeArg(node) }
7676}
7677impl From<ConstArg> for GenericArg {
7678 #[inline]
7679 fn from(node: ConstArg) -> GenericArg { GenericArg::ConstArg(node) }
7680}
7681impl From<LifetimeArg> for GenericArg {
7682 #[inline]
7683 fn from(node: LifetimeArg) -> GenericArg { GenericArg::LifetimeArg(node) }
7684}
7685impl From<TypeArg> for GenericArg {
7686 #[inline]
7687 fn from(node: TypeArg) -> GenericArg { GenericArg::TypeArg(node) }
7688}
7689impl AstNode for GenericArg {
7690 #[inline]
7691 fn can_cast(kind: SyntaxKind) -> bool {
7692 matches!(kind, ASSOC_TYPE_ARG | CONST_ARG | LIFETIME_ARG | TYPE_ARG)
7693 }
7694 #[inline]
7695 fn cast(syntax: SyntaxNode) -> Option<Self> {
7696 let res = match syntax.kind() {
7697 ASSOC_TYPE_ARG => GenericArg::AssocTypeArg(AssocTypeArg { syntax }),
7698 CONST_ARG => GenericArg::ConstArg(ConstArg { syntax }),
7699 LIFETIME_ARG => GenericArg::LifetimeArg(LifetimeArg { syntax }),
7700 TYPE_ARG => GenericArg::TypeArg(TypeArg { syntax }),
7701 _ => return None,
7702 };
7703 Some(res)
7704 }
7705 #[inline]
7706 fn syntax(&self) -> &SyntaxNode {
7707 match self {
7708 GenericArg::AssocTypeArg(it) => &it.syntax,
7709 GenericArg::ConstArg(it) => &it.syntax,
7710 GenericArg::LifetimeArg(it) => &it.syntax,
7711 GenericArg::TypeArg(it) => &it.syntax,
7712 }
7713 }
7714}
7715impl From<ConstParam> for GenericParam {
7716 #[inline]
7717 fn from(node: ConstParam) -> GenericParam { GenericParam::ConstParam(node) }
7718}
7719impl From<LifetimeParam> for GenericParam {
7720 #[inline]
7721 fn from(node: LifetimeParam) -> GenericParam { GenericParam::LifetimeParam(node) }
7722}
7723impl From<TypeParam> for GenericParam {
7724 #[inline]
7725 fn from(node: TypeParam) -> GenericParam { GenericParam::TypeParam(node) }
7726}
7727impl AstNode for GenericParam {
7728 #[inline]
7729 fn can_cast(kind: SyntaxKind) -> bool {
7730 matches!(kind, CONST_PARAM | LIFETIME_PARAM | TYPE_PARAM)
7731 }
7732 #[inline]
7733 fn cast(syntax: SyntaxNode) -> Option<Self> {
7734 let res = match syntax.kind() {
7735 CONST_PARAM => GenericParam::ConstParam(ConstParam { syntax }),
7736 LIFETIME_PARAM => GenericParam::LifetimeParam(LifetimeParam { syntax }),
7737 TYPE_PARAM => GenericParam::TypeParam(TypeParam { syntax }),
7738 _ => return None,
7739 };
7740 Some(res)
7741 }
7742 #[inline]
7743 fn syntax(&self) -> &SyntaxNode {
7744 match self {
7745 GenericParam::ConstParam(it) => &it.syntax,
7746 GenericParam::LifetimeParam(it) => &it.syntax,
7747 GenericParam::TypeParam(it) => &it.syntax,
7748 }
7749 }
7750}
7751impl From<AsmExpr> for Item {
7752 #[inline]
7753 fn from(node: AsmExpr) -> Item { Item::AsmExpr(node) }
7754}
7755impl From<Const> for Item {
7756 #[inline]
7757 fn from(node: Const) -> Item { Item::Const(node) }
7758}
7759impl From<Enum> for Item {
7760 #[inline]
7761 fn from(node: Enum) -> Item { Item::Enum(node) }
7762}
7763impl From<ExternBlock> for Item {
7764 #[inline]
7765 fn from(node: ExternBlock) -> Item { Item::ExternBlock(node) }
7766}
7767impl From<ExternCrate> for Item {
7768 #[inline]
7769 fn from(node: ExternCrate) -> Item { Item::ExternCrate(node) }
7770}
7771impl From<Fn> for Item {
7772 #[inline]
7773 fn from(node: Fn) -> Item { Item::Fn(node) }
7774}
7775impl From<Impl> for Item {
7776 #[inline]
7777 fn from(node: Impl) -> Item { Item::Impl(node) }
7778}
7779impl From<MacroCall> for Item {
7780 #[inline]
7781 fn from(node: MacroCall) -> Item { Item::MacroCall(node) }
7782}
7783impl From<MacroDef> for Item {
7784 #[inline]
7785 fn from(node: MacroDef) -> Item { Item::MacroDef(node) }
7786}
7787impl From<MacroRules> for Item {
7788 #[inline]
7789 fn from(node: MacroRules) -> Item { Item::MacroRules(node) }
7790}
7791impl From<Module> for Item {
7792 #[inline]
7793 fn from(node: Module) -> Item { Item::Module(node) }
7794}
7795impl From<Static> for Item {
7796 #[inline]
7797 fn from(node: Static) -> Item { Item::Static(node) }
7798}
7799impl From<Struct> for Item {
7800 #[inline]
7801 fn from(node: Struct) -> Item { Item::Struct(node) }
7802}
7803impl From<Trait> for Item {
7804 #[inline]
7805 fn from(node: Trait) -> Item { Item::Trait(node) }
7806}
7807impl From<TypeAlias> for Item {
7808 #[inline]
7809 fn from(node: TypeAlias) -> Item { Item::TypeAlias(node) }
7810}
7811impl From<Union> for Item {
7812 #[inline]
7813 fn from(node: Union) -> Item { Item::Union(node) }
7814}
7815impl From<Use> for Item {
7816 #[inline]
7817 fn from(node: Use) -> Item { Item::Use(node) }
7818}
7819impl AstNode for Item {
7820 #[inline]
7821 fn can_cast(kind: SyntaxKind) -> bool {
7822 matches!(
7823 kind,
7824 ASM_EXPR
7825 | CONST
7826 | ENUM
7827 | EXTERN_BLOCK
7828 | EXTERN_CRATE
7829 | FN
7830 | IMPL
7831 | MACRO_CALL
7832 | MACRO_DEF
7833 | MACRO_RULES
7834 | MODULE
7835 | STATIC
7836 | STRUCT
7837 | TRAIT
7838 | TYPE_ALIAS
7839 | UNION
7840 | USE
7841 )
7842 }
7843 #[inline]
7844 fn cast(syntax: SyntaxNode) -> Option<Self> {
7845 let res = match syntax.kind() {
7846 ASM_EXPR => Item::AsmExpr(AsmExpr { syntax }),
7847 CONST => Item::Const(Const { syntax }),
7848 ENUM => Item::Enum(Enum { syntax }),
7849 EXTERN_BLOCK => Item::ExternBlock(ExternBlock { syntax }),
7850 EXTERN_CRATE => Item::ExternCrate(ExternCrate { syntax }),
7851 FN => Item::Fn(Fn { syntax }),
7852 IMPL => Item::Impl(Impl { syntax }),
7853 MACRO_CALL => Item::MacroCall(MacroCall { syntax }),
7854 MACRO_DEF => Item::MacroDef(MacroDef { syntax }),
7855 MACRO_RULES => Item::MacroRules(MacroRules { syntax }),
7856 MODULE => Item::Module(Module { syntax }),
7857 STATIC => Item::Static(Static { syntax }),
7858 STRUCT => Item::Struct(Struct { syntax }),
7859 TRAIT => Item::Trait(Trait { syntax }),
7860 TYPE_ALIAS => Item::TypeAlias(TypeAlias { syntax }),
7861 UNION => Item::Union(Union { syntax }),
7862 USE => Item::Use(Use { syntax }),
7863 _ => return None,
7864 };
7865 Some(res)
7866 }
7867 #[inline]
7868 fn syntax(&self) -> &SyntaxNode {
7869 match self {
7870 Item::AsmExpr(it) => &it.syntax,
7871 Item::Const(it) => &it.syntax,
7872 Item::Enum(it) => &it.syntax,
7873 Item::ExternBlock(it) => &it.syntax,
7874 Item::ExternCrate(it) => &it.syntax,
7875 Item::Fn(it) => &it.syntax,
7876 Item::Impl(it) => &it.syntax,
7877 Item::MacroCall(it) => &it.syntax,
7878 Item::MacroDef(it) => &it.syntax,
7879 Item::MacroRules(it) => &it.syntax,
7880 Item::Module(it) => &it.syntax,
7881 Item::Static(it) => &it.syntax,
7882 Item::Struct(it) => &it.syntax,
7883 Item::Trait(it) => &it.syntax,
7884 Item::TypeAlias(it) => &it.syntax,
7885 Item::Union(it) => &it.syntax,
7886 Item::Use(it) => &it.syntax,
7887 }
7888 }
7889}
7890impl From<BoxPat> for Pat {
7891 #[inline]
7892 fn from(node: BoxPat) -> Pat { Pat::BoxPat(node) }
7893}
7894impl From<ConstBlockPat> for Pat {
7895 #[inline]
7896 fn from(node: ConstBlockPat) -> Pat { Pat::ConstBlockPat(node) }
7897}
7898impl From<IdentPat> for Pat {
7899 #[inline]
7900 fn from(node: IdentPat) -> Pat { Pat::IdentPat(node) }
7901}
7902impl From<LiteralPat> for Pat {
7903 #[inline]
7904 fn from(node: LiteralPat) -> Pat { Pat::LiteralPat(node) }
7905}
7906impl From<MacroPat> for Pat {
7907 #[inline]
7908 fn from(node: MacroPat) -> Pat { Pat::MacroPat(node) }
7909}
7910impl From<OrPat> for Pat {
7911 #[inline]
7912 fn from(node: OrPat) -> Pat { Pat::OrPat(node) }
7913}
7914impl From<ParenPat> for Pat {
7915 #[inline]
7916 fn from(node: ParenPat) -> Pat { Pat::ParenPat(node) }
7917}
7918impl From<PathPat> for Pat {
7919 #[inline]
7920 fn from(node: PathPat) -> Pat { Pat::PathPat(node) }
7921}
7922impl From<RangePat> for Pat {
7923 #[inline]
7924 fn from(node: RangePat) -> Pat { Pat::RangePat(node) }
7925}
7926impl From<RecordPat> for Pat {
7927 #[inline]
7928 fn from(node: RecordPat) -> Pat { Pat::RecordPat(node) }
7929}
7930impl From<RefPat> for Pat {
7931 #[inline]
7932 fn from(node: RefPat) -> Pat { Pat::RefPat(node) }
7933}
7934impl From<RestPat> for Pat {
7935 #[inline]
7936 fn from(node: RestPat) -> Pat { Pat::RestPat(node) }
7937}
7938impl From<SlicePat> for Pat {
7939 #[inline]
7940 fn from(node: SlicePat) -> Pat { Pat::SlicePat(node) }
7941}
7942impl From<TuplePat> for Pat {
7943 #[inline]
7944 fn from(node: TuplePat) -> Pat { Pat::TuplePat(node) }
7945}
7946impl From<TupleStructPat> for Pat {
7947 #[inline]
7948 fn from(node: TupleStructPat) -> Pat { Pat::TupleStructPat(node) }
7949}
7950impl From<WildcardPat> for Pat {
7951 #[inline]
7952 fn from(node: WildcardPat) -> Pat { Pat::WildcardPat(node) }
7953}
7954impl AstNode for Pat {
7955 #[inline]
7956 fn can_cast(kind: SyntaxKind) -> bool {
7957 matches!(
7958 kind,
7959 BOX_PAT
7960 | CONST_BLOCK_PAT
7961 | IDENT_PAT
7962 | LITERAL_PAT
7963 | MACRO_PAT
7964 | OR_PAT
7965 | PAREN_PAT
7966 | PATH_PAT
7967 | RANGE_PAT
7968 | RECORD_PAT
7969 | REF_PAT
7970 | REST_PAT
7971 | SLICE_PAT
7972 | TUPLE_PAT
7973 | TUPLE_STRUCT_PAT
7974 | WILDCARD_PAT
7975 )
7976 }
7977 #[inline]
7978 fn cast(syntax: SyntaxNode) -> Option<Self> {
7979 let res = match syntax.kind() {
7980 BOX_PAT => Pat::BoxPat(BoxPat { syntax }),
7981 CONST_BLOCK_PAT => Pat::ConstBlockPat(ConstBlockPat { syntax }),
7982 IDENT_PAT => Pat::IdentPat(IdentPat { syntax }),
7983 LITERAL_PAT => Pat::LiteralPat(LiteralPat { syntax }),
7984 MACRO_PAT => Pat::MacroPat(MacroPat { syntax }),
7985 OR_PAT => Pat::OrPat(OrPat { syntax }),
7986 PAREN_PAT => Pat::ParenPat(ParenPat { syntax }),
7987 PATH_PAT => Pat::PathPat(PathPat { syntax }),
7988 RANGE_PAT => Pat::RangePat(RangePat { syntax }),
7989 RECORD_PAT => Pat::RecordPat(RecordPat { syntax }),
7990 REF_PAT => Pat::RefPat(RefPat { syntax }),
7991 REST_PAT => Pat::RestPat(RestPat { syntax }),
7992 SLICE_PAT => Pat::SlicePat(SlicePat { syntax }),
7993 TUPLE_PAT => Pat::TuplePat(TuplePat { syntax }),
7994 TUPLE_STRUCT_PAT => Pat::TupleStructPat(TupleStructPat { syntax }),
7995 WILDCARD_PAT => Pat::WildcardPat(WildcardPat { syntax }),
7996 _ => return None,
7997 };
7998 Some(res)
7999 }
8000 #[inline]
8001 fn syntax(&self) -> &SyntaxNode {
8002 match self {
8003 Pat::BoxPat(it) => &it.syntax,
8004 Pat::ConstBlockPat(it) => &it.syntax,
8005 Pat::IdentPat(it) => &it.syntax,
8006 Pat::LiteralPat(it) => &it.syntax,
8007 Pat::MacroPat(it) => &it.syntax,
8008 Pat::OrPat(it) => &it.syntax,
8009 Pat::ParenPat(it) => &it.syntax,
8010 Pat::PathPat(it) => &it.syntax,
8011 Pat::RangePat(it) => &it.syntax,
8012 Pat::RecordPat(it) => &it.syntax,
8013 Pat::RefPat(it) => &it.syntax,
8014 Pat::RestPat(it) => &it.syntax,
8015 Pat::SlicePat(it) => &it.syntax,
8016 Pat::TuplePat(it) => &it.syntax,
8017 Pat::TupleStructPat(it) => &it.syntax,
8018 Pat::WildcardPat(it) => &it.syntax,
8019 }
8020 }
8021}
8022impl From<ExprStmt> for Stmt {
8023 #[inline]
8024 fn from(node: ExprStmt) -> Stmt { Stmt::ExprStmt(node) }
8025}
8026impl From<Item> for Stmt {
8027 #[inline]
8028 fn from(node: Item) -> Stmt { Stmt::Item(node) }
8029}
8030impl From<LetStmt> for Stmt {
8031 #[inline]
8032 fn from(node: LetStmt) -> Stmt { Stmt::LetStmt(node) }
8033}
8034impl From<ArrayType> for Type {
8035 #[inline]
8036 fn from(node: ArrayType) -> Type { Type::ArrayType(node) }
8037}
8038impl From<DynTraitType> for Type {
8039 #[inline]
8040 fn from(node: DynTraitType) -> Type { Type::DynTraitType(node) }
8041}
8042impl From<FnPtrType> for Type {
8043 #[inline]
8044 fn from(node: FnPtrType) -> Type { Type::FnPtrType(node) }
8045}
8046impl From<ForType> for Type {
8047 #[inline]
8048 fn from(node: ForType) -> Type { Type::ForType(node) }
8049}
8050impl From<ImplTraitType> for Type {
8051 #[inline]
8052 fn from(node: ImplTraitType) -> Type { Type::ImplTraitType(node) }
8053}
8054impl From<InferType> for Type {
8055 #[inline]
8056 fn from(node: InferType) -> Type { Type::InferType(node) }
8057}
8058impl From<MacroType> for Type {
8059 #[inline]
8060 fn from(node: MacroType) -> Type { Type::MacroType(node) }
8061}
8062impl From<NeverType> for Type {
8063 #[inline]
8064 fn from(node: NeverType) -> Type { Type::NeverType(node) }
8065}
8066impl From<ParenType> for Type {
8067 #[inline]
8068 fn from(node: ParenType) -> Type { Type::ParenType(node) }
8069}
8070impl From<PathType> for Type {
8071 #[inline]
8072 fn from(node: PathType) -> Type { Type::PathType(node) }
8073}
8074impl From<PtrType> for Type {
8075 #[inline]
8076 fn from(node: PtrType) -> Type { Type::PtrType(node) }
8077}
8078impl From<RefType> for Type {
8079 #[inline]
8080 fn from(node: RefType) -> Type { Type::RefType(node) }
8081}
8082impl From<SliceType> for Type {
8083 #[inline]
8084 fn from(node: SliceType) -> Type { Type::SliceType(node) }
8085}
8086impl From<TupleType> for Type {
8087 #[inline]
8088 fn from(node: TupleType) -> Type { Type::TupleType(node) }
8089}
8090impl AstNode for Type {
8091 #[inline]
8092 fn can_cast(kind: SyntaxKind) -> bool {
8093 matches!(
8094 kind,
8095 ARRAY_TYPE
8096 | DYN_TRAIT_TYPE
8097 | FN_PTR_TYPE
8098 | FOR_TYPE
8099 | IMPL_TRAIT_TYPE
8100 | INFER_TYPE
8101 | MACRO_TYPE
8102 | NEVER_TYPE
8103 | PAREN_TYPE
8104 | PATH_TYPE
8105 | PTR_TYPE
8106 | REF_TYPE
8107 | SLICE_TYPE
8108 | TUPLE_TYPE
8109 )
8110 }
8111 #[inline]
8112 fn cast(syntax: SyntaxNode) -> Option<Self> {
8113 let res = match syntax.kind() {
8114 ARRAY_TYPE => Type::ArrayType(ArrayType { syntax }),
8115 DYN_TRAIT_TYPE => Type::DynTraitType(DynTraitType { syntax }),
8116 FN_PTR_TYPE => Type::FnPtrType(FnPtrType { syntax }),
8117 FOR_TYPE => Type::ForType(ForType { syntax }),
8118 IMPL_TRAIT_TYPE => Type::ImplTraitType(ImplTraitType { syntax }),
8119 INFER_TYPE => Type::InferType(InferType { syntax }),
8120 MACRO_TYPE => Type::MacroType(MacroType { syntax }),
8121 NEVER_TYPE => Type::NeverType(NeverType { syntax }),
8122 PAREN_TYPE => Type::ParenType(ParenType { syntax }),
8123 PATH_TYPE => Type::PathType(PathType { syntax }),
8124 PTR_TYPE => Type::PtrType(PtrType { syntax }),
8125 REF_TYPE => Type::RefType(RefType { syntax }),
8126 SLICE_TYPE => Type::SliceType(SliceType { syntax }),
8127 TUPLE_TYPE => Type::TupleType(TupleType { syntax }),
8128 _ => return None,
8129 };
8130 Some(res)
8131 }
8132 #[inline]
8133 fn syntax(&self) -> &SyntaxNode {
8134 match self {
8135 Type::ArrayType(it) => &it.syntax,
8136 Type::DynTraitType(it) => &it.syntax,
8137 Type::FnPtrType(it) => &it.syntax,
8138 Type::ForType(it) => &it.syntax,
8139 Type::ImplTraitType(it) => &it.syntax,
8140 Type::InferType(it) => &it.syntax,
8141 Type::MacroType(it) => &it.syntax,
8142 Type::NeverType(it) => &it.syntax,
8143 Type::ParenType(it) => &it.syntax,
8144 Type::PathType(it) => &it.syntax,
8145 Type::PtrType(it) => &it.syntax,
8146 Type::RefType(it) => &it.syntax,
8147 Type::SliceType(it) => &it.syntax,
8148 Type::TupleType(it) => &it.syntax,
8149 }
8150 }
8151}
8152impl From<Lifetime> for UseBoundGenericArg {
8153 #[inline]
8154 fn from(node: Lifetime) -> UseBoundGenericArg { UseBoundGenericArg::Lifetime(node) }
8155}
8156impl From<NameRef> for UseBoundGenericArg {
8157 #[inline]
8158 fn from(node: NameRef) -> UseBoundGenericArg { UseBoundGenericArg::NameRef(node) }
8159}
8160impl AstNode for UseBoundGenericArg {
8161 #[inline]
8162 fn can_cast(kind: SyntaxKind) -> bool { matches!(kind, LIFETIME | NAME_REF) }
8163 #[inline]
8164 fn cast(syntax: SyntaxNode) -> Option<Self> {
8165 let res = match syntax.kind() {
8166 LIFETIME => UseBoundGenericArg::Lifetime(Lifetime { syntax }),
8167 NAME_REF => UseBoundGenericArg::NameRef(NameRef { syntax }),
8168 _ => return None,
8169 };
8170 Some(res)
8171 }
8172 #[inline]
8173 fn syntax(&self) -> &SyntaxNode {
8174 match self {
8175 UseBoundGenericArg::Lifetime(it) => &it.syntax,
8176 UseBoundGenericArg::NameRef(it) => &it.syntax,
8177 }
8178 }
8179}
8180impl From<Struct> for VariantDef {
8181 #[inline]
8182 fn from(node: Struct) -> VariantDef { VariantDef::Struct(node) }
8183}
8184impl From<Union> for VariantDef {
8185 #[inline]
8186 fn from(node: Union) -> VariantDef { VariantDef::Union(node) }
8187}
8188impl From<Variant> for VariantDef {
8189 #[inline]
8190 fn from(node: Variant) -> VariantDef { VariantDef::Variant(node) }
8191}
8192impl AstNode for VariantDef {
8193 #[inline]
8194 fn can_cast(kind: SyntaxKind) -> bool { matches!(kind, STRUCT | UNION | VARIANT) }
8195 #[inline]
8196 fn cast(syntax: SyntaxNode) -> Option<Self> {
8197 let res = match syntax.kind() {
8198 STRUCT => VariantDef::Struct(Struct { syntax }),
8199 UNION => VariantDef::Union(Union { syntax }),
8200 VARIANT => VariantDef::Variant(Variant { syntax }),
8201 _ => return None,
8202 };
8203 Some(res)
8204 }
8205 #[inline]
8206 fn syntax(&self) -> &SyntaxNode {
8207 match self {
8208 VariantDef::Struct(it) => &it.syntax,
8209 VariantDef::Union(it) => &it.syntax,
8210 VariantDef::Variant(it) => &it.syntax,
8211 }
8212 }
8213}
8214impl ast::HasArgList for AnyHasArgList {}
8215impl AstNode for AnyHasArgList {
8216 #[inline]
8217 fn can_cast(kind: SyntaxKind) -> bool { matches!(kind, CALL_EXPR | METHOD_CALL_EXPR) }
8218 #[inline]
8219 fn cast(syntax: SyntaxNode) -> Option<Self> {
8220 Self::can_cast(syntax.kind()).then_some(AnyHasArgList { syntax })
8221 }
8222 #[inline]
8223 fn syntax(&self) -> &SyntaxNode { &self.syntax }
8224}
8225impl hash::Hash for AnyHasArgList {
8226 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
8227}
8228impl Eq for AnyHasArgList {}
8229impl PartialEq for AnyHasArgList {
8230 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
8231}
8232impl Clone for AnyHasArgList {
8233 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
8234}
8235impl fmt::Debug for AnyHasArgList {
8236 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
8237 f.debug_struct("AnyHasArgList").field("syntax", &self.syntax).finish()
8238 }
8239}
8240impl From<CallExpr> for AnyHasArgList {
8241 #[inline]
8242 fn from(node: CallExpr) -> AnyHasArgList { AnyHasArgList { syntax: node.syntax } }
8243}
8244impl From<MethodCallExpr> for AnyHasArgList {
8245 #[inline]
8246 fn from(node: MethodCallExpr) -> AnyHasArgList { AnyHasArgList { syntax: node.syntax } }
8247}
8248impl ast::HasAttrs for AnyHasAttrs {}
8249impl AstNode for AnyHasAttrs {
8250 #[inline]
8251 fn can_cast(kind: SyntaxKind) -> bool {
8252 matches!(
8253 kind,
8254 ARRAY_EXPR
8255 | ASM_EXPR
8256 | ASSOC_ITEM_LIST
8257 | AWAIT_EXPR
8258 | BECOME_EXPR
8259 | BIN_EXPR
8260 | BLOCK_EXPR
8261 | BREAK_EXPR
8262 | CALL_EXPR
8263 | CAST_EXPR
8264 | CLOSURE_EXPR
8265 | CONST
8266 | CONST_PARAM
8267 | CONTINUE_EXPR
8268 | ENUM
8269 | EXTERN_BLOCK
8270 | EXTERN_CRATE
8271 | EXTERN_ITEM_LIST
8272 | FIELD_EXPR
8273 | FN
8274 | FOR_EXPR
8275 | FORMAT_ARGS_EXPR
8276 | IDENT_PAT
8277 | IF_EXPR
8278 | IMPL
8279 | INDEX_EXPR
8280 | ITEM_LIST
8281 | LET_EXPR
8282 | LET_STMT
8283 | LIFETIME_PARAM
8284 | LITERAL
8285 | LOOP_EXPR
8286 | MACRO_CALL
8287 | MACRO_DEF
8288 | MACRO_RULES
8289 | MATCH_ARM
8290 | MATCH_ARM_LIST
8291 | MATCH_EXPR
8292 | METHOD_CALL_EXPR
8293 | MODULE
8294 | OFFSET_OF_EXPR
8295 | PARAM
8296 | PAREN_EXPR
8297 | PATH_EXPR
8298 | PREFIX_EXPR
8299 | RANGE_EXPR
8300 | RECORD_EXPR_FIELD
8301 | RECORD_EXPR_FIELD_LIST
8302 | RECORD_FIELD
8303 | RECORD_PAT_FIELD
8304 | REF_EXPR
8305 | REST_PAT
8306 | RETURN_EXPR
8307 | SELF_PARAM
8308 | SOURCE_FILE
8309 | STATIC
8310 | STMT_LIST
8311 | STRUCT
8312 | TRAIT
8313 | TRY_EXPR
8314 | TUPLE_EXPR
8315 | TUPLE_FIELD
8316 | TYPE_ALIAS
8317 | TYPE_PARAM
8318 | UNDERSCORE_EXPR
8319 | UNION
8320 | USE
8321 | VARIANT
8322 | WHILE_EXPR
8323 | YEET_EXPR
8324 | YIELD_EXPR
8325 )
8326 }
8327 #[inline]
8328 fn cast(syntax: SyntaxNode) -> Option<Self> {
8329 Self::can_cast(syntax.kind()).then_some(AnyHasAttrs { syntax })
8330 }
8331 #[inline]
8332 fn syntax(&self) -> &SyntaxNode { &self.syntax }
8333}
8334impl hash::Hash for AnyHasAttrs {
8335 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
8336}
8337impl Eq for AnyHasAttrs {}
8338impl PartialEq for AnyHasAttrs {
8339 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
8340}
8341impl Clone for AnyHasAttrs {
8342 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
8343}
8344impl fmt::Debug for AnyHasAttrs {
8345 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
8346 f.debug_struct("AnyHasAttrs").field("syntax", &self.syntax).finish()
8347 }
8348}
8349impl From<ArrayExpr> for AnyHasAttrs {
8350 #[inline]
8351 fn from(node: ArrayExpr) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
8352}
8353impl From<AsmExpr> for AnyHasAttrs {
8354 #[inline]
8355 fn from(node: AsmExpr) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
8356}
8357impl From<AssocItemList> for AnyHasAttrs {
8358 #[inline]
8359 fn from(node: AssocItemList) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
8360}
8361impl From<AwaitExpr> for AnyHasAttrs {
8362 #[inline]
8363 fn from(node: AwaitExpr) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
8364}
8365impl From<BecomeExpr> for AnyHasAttrs {
8366 #[inline]
8367 fn from(node: BecomeExpr) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
8368}
8369impl From<BinExpr> for AnyHasAttrs {
8370 #[inline]
8371 fn from(node: BinExpr) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
8372}
8373impl From<BlockExpr> for AnyHasAttrs {
8374 #[inline]
8375 fn from(node: BlockExpr) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
8376}
8377impl From<BreakExpr> for AnyHasAttrs {
8378 #[inline]
8379 fn from(node: BreakExpr) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
8380}
8381impl From<CallExpr> for AnyHasAttrs {
8382 #[inline]
8383 fn from(node: CallExpr) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
8384}
8385impl From<CastExpr> for AnyHasAttrs {
8386 #[inline]
8387 fn from(node: CastExpr) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
8388}
8389impl From<ClosureExpr> for AnyHasAttrs {
8390 #[inline]
8391 fn from(node: ClosureExpr) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
8392}
8393impl From<Const> for AnyHasAttrs {
8394 #[inline]
8395 fn from(node: Const) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
8396}
8397impl From<ConstParam> for AnyHasAttrs {
8398 #[inline]
8399 fn from(node: ConstParam) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
8400}
8401impl From<ContinueExpr> for AnyHasAttrs {
8402 #[inline]
8403 fn from(node: ContinueExpr) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
8404}
8405impl From<Enum> for AnyHasAttrs {
8406 #[inline]
8407 fn from(node: Enum) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
8408}
8409impl From<ExternBlock> for AnyHasAttrs {
8410 #[inline]
8411 fn from(node: ExternBlock) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
8412}
8413impl From<ExternCrate> for AnyHasAttrs {
8414 #[inline]
8415 fn from(node: ExternCrate) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
8416}
8417impl From<ExternItemList> for AnyHasAttrs {
8418 #[inline]
8419 fn from(node: ExternItemList) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
8420}
8421impl From<FieldExpr> for AnyHasAttrs {
8422 #[inline]
8423 fn from(node: FieldExpr) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
8424}
8425impl From<Fn> for AnyHasAttrs {
8426 #[inline]
8427 fn from(node: Fn) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
8428}
8429impl From<ForExpr> for AnyHasAttrs {
8430 #[inline]
8431 fn from(node: ForExpr) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
8432}
8433impl From<FormatArgsExpr> for AnyHasAttrs {
8434 #[inline]
8435 fn from(node: FormatArgsExpr) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
8436}
8437impl From<IdentPat> for AnyHasAttrs {
8438 #[inline]
8439 fn from(node: IdentPat) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
8440}
8441impl From<IfExpr> for AnyHasAttrs {
8442 #[inline]
8443 fn from(node: IfExpr) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
8444}
8445impl From<Impl> for AnyHasAttrs {
8446 #[inline]
8447 fn from(node: Impl) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
8448}
8449impl From<IndexExpr> for AnyHasAttrs {
8450 #[inline]
8451 fn from(node: IndexExpr) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
8452}
8453impl From<ItemList> for AnyHasAttrs {
8454 #[inline]
8455 fn from(node: ItemList) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
8456}
8457impl From<LetExpr> for AnyHasAttrs {
8458 #[inline]
8459 fn from(node: LetExpr) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
8460}
8461impl From<LetStmt> for AnyHasAttrs {
8462 #[inline]
8463 fn from(node: LetStmt) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
8464}
8465impl From<LifetimeParam> for AnyHasAttrs {
8466 #[inline]
8467 fn from(node: LifetimeParam) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
8468}
8469impl From<Literal> for AnyHasAttrs {
8470 #[inline]
8471 fn from(node: Literal) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
8472}
8473impl From<LoopExpr> for AnyHasAttrs {
8474 #[inline]
8475 fn from(node: LoopExpr) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
8476}
8477impl From<MacroCall> for AnyHasAttrs {
8478 #[inline]
8479 fn from(node: MacroCall) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
8480}
8481impl From<MacroDef> for AnyHasAttrs {
8482 #[inline]
8483 fn from(node: MacroDef) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
8484}
8485impl From<MacroRules> for AnyHasAttrs {
8486 #[inline]
8487 fn from(node: MacroRules) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
8488}
8489impl From<MatchArm> for AnyHasAttrs {
8490 #[inline]
8491 fn from(node: MatchArm) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
8492}
8493impl From<MatchArmList> for AnyHasAttrs {
8494 #[inline]
8495 fn from(node: MatchArmList) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
8496}
8497impl From<MatchExpr> for AnyHasAttrs {
8498 #[inline]
8499 fn from(node: MatchExpr) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
8500}
8501impl From<MethodCallExpr> for AnyHasAttrs {
8502 #[inline]
8503 fn from(node: MethodCallExpr) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
8504}
8505impl From<Module> for AnyHasAttrs {
8506 #[inline]
8507 fn from(node: Module) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
8508}
8509impl From<OffsetOfExpr> for AnyHasAttrs {
8510 #[inline]
8511 fn from(node: OffsetOfExpr) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
8512}
8513impl From<Param> for AnyHasAttrs {
8514 #[inline]
8515 fn from(node: Param) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
8516}
8517impl From<ParenExpr> for AnyHasAttrs {
8518 #[inline]
8519 fn from(node: ParenExpr) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
8520}
8521impl From<PathExpr> for AnyHasAttrs {
8522 #[inline]
8523 fn from(node: PathExpr) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
8524}
8525impl From<PrefixExpr> for AnyHasAttrs {
8526 #[inline]
8527 fn from(node: PrefixExpr) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
8528}
8529impl From<RangeExpr> for AnyHasAttrs {
8530 #[inline]
8531 fn from(node: RangeExpr) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
8532}
8533impl From<RecordExprField> for AnyHasAttrs {
8534 #[inline]
8535 fn from(node: RecordExprField) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
8536}
8537impl From<RecordExprFieldList> for AnyHasAttrs {
8538 #[inline]
8539 fn from(node: RecordExprFieldList) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
8540}
8541impl From<RecordField> for AnyHasAttrs {
8542 #[inline]
8543 fn from(node: RecordField) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
8544}
8545impl From<RecordPatField> for AnyHasAttrs {
8546 #[inline]
8547 fn from(node: RecordPatField) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
8548}
8549impl From<RefExpr> for AnyHasAttrs {
8550 #[inline]
8551 fn from(node: RefExpr) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
8552}
8553impl From<RestPat> for AnyHasAttrs {
8554 #[inline]
8555 fn from(node: RestPat) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
8556}
8557impl From<ReturnExpr> for AnyHasAttrs {
8558 #[inline]
8559 fn from(node: ReturnExpr) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
8560}
8561impl From<SelfParam> for AnyHasAttrs {
8562 #[inline]
8563 fn from(node: SelfParam) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
8564}
8565impl From<SourceFile> for AnyHasAttrs {
8566 #[inline]
8567 fn from(node: SourceFile) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
8568}
8569impl From<Static> for AnyHasAttrs {
8570 #[inline]
8571 fn from(node: Static) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
8572}
8573impl From<StmtList> for AnyHasAttrs {
8574 #[inline]
8575 fn from(node: StmtList) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
8576}
8577impl From<Struct> for AnyHasAttrs {
8578 #[inline]
8579 fn from(node: Struct) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
8580}
8581impl From<Trait> for AnyHasAttrs {
8582 #[inline]
8583 fn from(node: Trait) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
8584}
8585impl From<TryExpr> for AnyHasAttrs {
8586 #[inline]
8587 fn from(node: TryExpr) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
8588}
8589impl From<TupleExpr> for AnyHasAttrs {
8590 #[inline]
8591 fn from(node: TupleExpr) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
8592}
8593impl From<TupleField> for AnyHasAttrs {
8594 #[inline]
8595 fn from(node: TupleField) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
8596}
8597impl From<TypeAlias> for AnyHasAttrs {
8598 #[inline]
8599 fn from(node: TypeAlias) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
8600}
8601impl From<TypeParam> for AnyHasAttrs {
8602 #[inline]
8603 fn from(node: TypeParam) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
8604}
8605impl From<UnderscoreExpr> for AnyHasAttrs {
8606 #[inline]
8607 fn from(node: UnderscoreExpr) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
8608}
8609impl From<Union> for AnyHasAttrs {
8610 #[inline]
8611 fn from(node: Union) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
8612}
8613impl From<Use> for AnyHasAttrs {
8614 #[inline]
8615 fn from(node: Use) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
8616}
8617impl From<Variant> for AnyHasAttrs {
8618 #[inline]
8619 fn from(node: Variant) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
8620}
8621impl From<WhileExpr> for AnyHasAttrs {
8622 #[inline]
8623 fn from(node: WhileExpr) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
8624}
8625impl From<YeetExpr> for AnyHasAttrs {
8626 #[inline]
8627 fn from(node: YeetExpr) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
8628}
8629impl From<YieldExpr> for AnyHasAttrs {
8630 #[inline]
8631 fn from(node: YieldExpr) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
8632}
8633impl ast::HasDocComments for AnyHasDocComments {}
8634impl AstNode for AnyHasDocComments {
8635 #[inline]
8636 fn can_cast(kind: SyntaxKind) -> bool {
8637 matches!(
8638 kind,
8639 CONST
8640 | ENUM
8641 | EXTERN_BLOCK
8642 | EXTERN_CRATE
8643 | FN
8644 | IMPL
8645 | MACRO_CALL
8646 | MACRO_DEF
8647 | MACRO_RULES
8648 | MODULE
8649 | RECORD_FIELD
8650 | SOURCE_FILE
8651 | STATIC
8652 | STRUCT
8653 | TRAIT
8654 | TUPLE_FIELD
8655 | TYPE_ALIAS
8656 | UNION
8657 | USE
8658 | VARIANT
8659 )
8660 }
8661 #[inline]
8662 fn cast(syntax: SyntaxNode) -> Option<Self> {
8663 Self::can_cast(syntax.kind()).then_some(AnyHasDocComments { syntax })
8664 }
8665 #[inline]
8666 fn syntax(&self) -> &SyntaxNode { &self.syntax }
8667}
8668impl hash::Hash for AnyHasDocComments {
8669 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
8670}
8671impl Eq for AnyHasDocComments {}
8672impl PartialEq for AnyHasDocComments {
8673 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
8674}
8675impl Clone for AnyHasDocComments {
8676 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
8677}
8678impl fmt::Debug for AnyHasDocComments {
8679 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
8680 f.debug_struct("AnyHasDocComments").field("syntax", &self.syntax).finish()
8681 }
8682}
8683impl From<Const> for AnyHasDocComments {
8684 #[inline]
8685 fn from(node: Const) -> AnyHasDocComments { AnyHasDocComments { syntax: node.syntax } }
8686}
8687impl From<Enum> for AnyHasDocComments {
8688 #[inline]
8689 fn from(node: Enum) -> AnyHasDocComments { AnyHasDocComments { syntax: node.syntax } }
8690}
8691impl From<ExternBlock> for AnyHasDocComments {
8692 #[inline]
8693 fn from(node: ExternBlock) -> AnyHasDocComments { AnyHasDocComments { syntax: node.syntax } }
8694}
8695impl From<ExternCrate> for AnyHasDocComments {
8696 #[inline]
8697 fn from(node: ExternCrate) -> AnyHasDocComments { AnyHasDocComments { syntax: node.syntax } }
8698}
8699impl From<Fn> for AnyHasDocComments {
8700 #[inline]
8701 fn from(node: Fn) -> AnyHasDocComments { AnyHasDocComments { syntax: node.syntax } }
8702}
8703impl From<Impl> for AnyHasDocComments {
8704 #[inline]
8705 fn from(node: Impl) -> AnyHasDocComments { AnyHasDocComments { syntax: node.syntax } }
8706}
8707impl From<MacroCall> for AnyHasDocComments {
8708 #[inline]
8709 fn from(node: MacroCall) -> AnyHasDocComments { AnyHasDocComments { syntax: node.syntax } }
8710}
8711impl From<MacroDef> for AnyHasDocComments {
8712 #[inline]
8713 fn from(node: MacroDef) -> AnyHasDocComments { AnyHasDocComments { syntax: node.syntax } }
8714}
8715impl From<MacroRules> for AnyHasDocComments {
8716 #[inline]
8717 fn from(node: MacroRules) -> AnyHasDocComments { AnyHasDocComments { syntax: node.syntax } }
8718}
8719impl From<Module> for AnyHasDocComments {
8720 #[inline]
8721 fn from(node: Module) -> AnyHasDocComments { AnyHasDocComments { syntax: node.syntax } }
8722}
8723impl From<RecordField> for AnyHasDocComments {
8724 #[inline]
8725 fn from(node: RecordField) -> AnyHasDocComments { AnyHasDocComments { syntax: node.syntax } }
8726}
8727impl From<SourceFile> for AnyHasDocComments {
8728 #[inline]
8729 fn from(node: SourceFile) -> AnyHasDocComments { AnyHasDocComments { syntax: node.syntax } }
8730}
8731impl From<Static> for AnyHasDocComments {
8732 #[inline]
8733 fn from(node: Static) -> AnyHasDocComments { AnyHasDocComments { syntax: node.syntax } }
8734}
8735impl From<Struct> for AnyHasDocComments {
8736 #[inline]
8737 fn from(node: Struct) -> AnyHasDocComments { AnyHasDocComments { syntax: node.syntax } }
8738}
8739impl From<Trait> for AnyHasDocComments {
8740 #[inline]
8741 fn from(node: Trait) -> AnyHasDocComments { AnyHasDocComments { syntax: node.syntax } }
8742}
8743impl From<TupleField> for AnyHasDocComments {
8744 #[inline]
8745 fn from(node: TupleField) -> AnyHasDocComments { AnyHasDocComments { syntax: node.syntax } }
8746}
8747impl From<TypeAlias> for AnyHasDocComments {
8748 #[inline]
8749 fn from(node: TypeAlias) -> AnyHasDocComments { AnyHasDocComments { syntax: node.syntax } }
8750}
8751impl From<Union> for AnyHasDocComments {
8752 #[inline]
8753 fn from(node: Union) -> AnyHasDocComments { AnyHasDocComments { syntax: node.syntax } }
8754}
8755impl From<Use> for AnyHasDocComments {
8756 #[inline]
8757 fn from(node: Use) -> AnyHasDocComments { AnyHasDocComments { syntax: node.syntax } }
8758}
8759impl From<Variant> for AnyHasDocComments {
8760 #[inline]
8761 fn from(node: Variant) -> AnyHasDocComments { AnyHasDocComments { syntax: node.syntax } }
8762}
8763impl ast::HasGenericArgs for AnyHasGenericArgs {}
8764impl AstNode for AnyHasGenericArgs {
8765 #[inline]
8766 fn can_cast(kind: SyntaxKind) -> bool {
8767 matches!(kind, ASSOC_TYPE_ARG | METHOD_CALL_EXPR | PATH_SEGMENT)
8768 }
8769 #[inline]
8770 fn cast(syntax: SyntaxNode) -> Option<Self> {
8771 Self::can_cast(syntax.kind()).then_some(AnyHasGenericArgs { syntax })
8772 }
8773 #[inline]
8774 fn syntax(&self) -> &SyntaxNode { &self.syntax }
8775}
8776impl hash::Hash for AnyHasGenericArgs {
8777 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
8778}
8779impl Eq for AnyHasGenericArgs {}
8780impl PartialEq for AnyHasGenericArgs {
8781 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
8782}
8783impl Clone for AnyHasGenericArgs {
8784 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
8785}
8786impl fmt::Debug for AnyHasGenericArgs {
8787 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
8788 f.debug_struct("AnyHasGenericArgs").field("syntax", &self.syntax).finish()
8789 }
8790}
8791impl From<AssocTypeArg> for AnyHasGenericArgs {
8792 #[inline]
8793 fn from(node: AssocTypeArg) -> AnyHasGenericArgs { AnyHasGenericArgs { syntax: node.syntax } }
8794}
8795impl From<MethodCallExpr> for AnyHasGenericArgs {
8796 #[inline]
8797 fn from(node: MethodCallExpr) -> AnyHasGenericArgs { AnyHasGenericArgs { syntax: node.syntax } }
8798}
8799impl From<PathSegment> for AnyHasGenericArgs {
8800 #[inline]
8801 fn from(node: PathSegment) -> AnyHasGenericArgs { AnyHasGenericArgs { syntax: node.syntax } }
8802}
8803impl ast::HasGenericParams for AnyHasGenericParams {}
8804impl AstNode for AnyHasGenericParams {
8805 #[inline]
8806 fn can_cast(kind: SyntaxKind) -> bool {
8807 matches!(kind, CONST | ENUM | FN | IMPL | STRUCT | TRAIT | TYPE_ALIAS | UNION)
8808 }
8809 #[inline]
8810 fn cast(syntax: SyntaxNode) -> Option<Self> {
8811 Self::can_cast(syntax.kind()).then_some(AnyHasGenericParams { syntax })
8812 }
8813 #[inline]
8814 fn syntax(&self) -> &SyntaxNode { &self.syntax }
8815}
8816impl hash::Hash for AnyHasGenericParams {
8817 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
8818}
8819impl Eq for AnyHasGenericParams {}
8820impl PartialEq for AnyHasGenericParams {
8821 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
8822}
8823impl Clone for AnyHasGenericParams {
8824 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
8825}
8826impl fmt::Debug for AnyHasGenericParams {
8827 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
8828 f.debug_struct("AnyHasGenericParams").field("syntax", &self.syntax).finish()
8829 }
8830}
8831impl From<Const> for AnyHasGenericParams {
8832 #[inline]
8833 fn from(node: Const) -> AnyHasGenericParams { AnyHasGenericParams { syntax: node.syntax } }
8834}
8835impl From<Enum> for AnyHasGenericParams {
8836 #[inline]
8837 fn from(node: Enum) -> AnyHasGenericParams { AnyHasGenericParams { syntax: node.syntax } }
8838}
8839impl From<Fn> for AnyHasGenericParams {
8840 #[inline]
8841 fn from(node: Fn) -> AnyHasGenericParams { AnyHasGenericParams { syntax: node.syntax } }
8842}
8843impl From<Impl> for AnyHasGenericParams {
8844 #[inline]
8845 fn from(node: Impl) -> AnyHasGenericParams { AnyHasGenericParams { syntax: node.syntax } }
8846}
8847impl From<Struct> for AnyHasGenericParams {
8848 #[inline]
8849 fn from(node: Struct) -> AnyHasGenericParams { AnyHasGenericParams { syntax: node.syntax } }
8850}
8851impl From<Trait> for AnyHasGenericParams {
8852 #[inline]
8853 fn from(node: Trait) -> AnyHasGenericParams { AnyHasGenericParams { syntax: node.syntax } }
8854}
8855impl From<TypeAlias> for AnyHasGenericParams {
8856 #[inline]
8857 fn from(node: TypeAlias) -> AnyHasGenericParams { AnyHasGenericParams { syntax: node.syntax } }
8858}
8859impl From<Union> for AnyHasGenericParams {
8860 #[inline]
8861 fn from(node: Union) -> AnyHasGenericParams { AnyHasGenericParams { syntax: node.syntax } }
8862}
8863impl ast::HasLoopBody for AnyHasLoopBody {}
8864impl AstNode for AnyHasLoopBody {
8865 #[inline]
8866 fn can_cast(kind: SyntaxKind) -> bool { matches!(kind, FOR_EXPR | LOOP_EXPR | WHILE_EXPR) }
8867 #[inline]
8868 fn cast(syntax: SyntaxNode) -> Option<Self> {
8869 Self::can_cast(syntax.kind()).then_some(AnyHasLoopBody { syntax })
8870 }
8871 #[inline]
8872 fn syntax(&self) -> &SyntaxNode { &self.syntax }
8873}
8874impl hash::Hash for AnyHasLoopBody {
8875 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
8876}
8877impl Eq for AnyHasLoopBody {}
8878impl PartialEq for AnyHasLoopBody {
8879 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
8880}
8881impl Clone for AnyHasLoopBody {
8882 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
8883}
8884impl fmt::Debug for AnyHasLoopBody {
8885 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
8886 f.debug_struct("AnyHasLoopBody").field("syntax", &self.syntax).finish()
8887 }
8888}
8889impl From<ForExpr> for AnyHasLoopBody {
8890 #[inline]
8891 fn from(node: ForExpr) -> AnyHasLoopBody { AnyHasLoopBody { syntax: node.syntax } }
8892}
8893impl From<LoopExpr> for AnyHasLoopBody {
8894 #[inline]
8895 fn from(node: LoopExpr) -> AnyHasLoopBody { AnyHasLoopBody { syntax: node.syntax } }
8896}
8897impl From<WhileExpr> for AnyHasLoopBody {
8898 #[inline]
8899 fn from(node: WhileExpr) -> AnyHasLoopBody { AnyHasLoopBody { syntax: node.syntax } }
8900}
8901impl ast::HasModuleItem for AnyHasModuleItem {}
8902impl AstNode for AnyHasModuleItem {
8903 #[inline]
8904 fn can_cast(kind: SyntaxKind) -> bool { matches!(kind, ITEM_LIST | MACRO_ITEMS | SOURCE_FILE) }
8905 #[inline]
8906 fn cast(syntax: SyntaxNode) -> Option<Self> {
8907 Self::can_cast(syntax.kind()).then_some(AnyHasModuleItem { syntax })
8908 }
8909 #[inline]
8910 fn syntax(&self) -> &SyntaxNode { &self.syntax }
8911}
8912impl hash::Hash for AnyHasModuleItem {
8913 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
8914}
8915impl Eq for AnyHasModuleItem {}
8916impl PartialEq for AnyHasModuleItem {
8917 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
8918}
8919impl Clone for AnyHasModuleItem {
8920 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
8921}
8922impl fmt::Debug for AnyHasModuleItem {
8923 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
8924 f.debug_struct("AnyHasModuleItem").field("syntax", &self.syntax).finish()
8925 }
8926}
8927impl From<ItemList> for AnyHasModuleItem {
8928 #[inline]
8929 fn from(node: ItemList) -> AnyHasModuleItem { AnyHasModuleItem { syntax: node.syntax } }
8930}
8931impl From<MacroItems> for AnyHasModuleItem {
8932 #[inline]
8933 fn from(node: MacroItems) -> AnyHasModuleItem { AnyHasModuleItem { syntax: node.syntax } }
8934}
8935impl From<SourceFile> for AnyHasModuleItem {
8936 #[inline]
8937 fn from(node: SourceFile) -> AnyHasModuleItem { AnyHasModuleItem { syntax: node.syntax } }
8938}
8939impl ast::HasName for AnyHasName {}
8940impl AstNode for AnyHasName {
8941 #[inline]
8942 fn can_cast(kind: SyntaxKind) -> bool {
8943 matches!(
8944 kind,
8945 ASM_OPERAND_NAMED
8946 | CONST
8947 | CONST_PARAM
8948 | ENUM
8949 | FN
8950 | FORMAT_ARGS_ARG
8951 | IDENT_PAT
8952 | MACRO_DEF
8953 | MACRO_RULES
8954 | MODULE
8955 | RECORD_FIELD
8956 | RENAME
8957 | SELF_PARAM
8958 | STATIC
8959 | STRUCT
8960 | TRAIT
8961 | TYPE_ALIAS
8962 | TYPE_PARAM
8963 | UNION
8964 | VARIANT
8965 )
8966 }
8967 #[inline]
8968 fn cast(syntax: SyntaxNode) -> Option<Self> {
8969 Self::can_cast(syntax.kind()).then_some(AnyHasName { syntax })
8970 }
8971 #[inline]
8972 fn syntax(&self) -> &SyntaxNode { &self.syntax }
8973}
8974impl hash::Hash for AnyHasName {
8975 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
8976}
8977impl Eq for AnyHasName {}
8978impl PartialEq for AnyHasName {
8979 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
8980}
8981impl Clone for AnyHasName {
8982 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
8983}
8984impl fmt::Debug for AnyHasName {
8985 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
8986 f.debug_struct("AnyHasName").field("syntax", &self.syntax).finish()
8987 }
8988}
8989impl From<AsmOperandNamed> for AnyHasName {
8990 #[inline]
8991 fn from(node: AsmOperandNamed) -> AnyHasName { AnyHasName { syntax: node.syntax } }
8992}
8993impl From<Const> for AnyHasName {
8994 #[inline]
8995 fn from(node: Const) -> AnyHasName { AnyHasName { syntax: node.syntax } }
8996}
8997impl From<ConstParam> for AnyHasName {
8998 #[inline]
8999 fn from(node: ConstParam) -> AnyHasName { AnyHasName { syntax: node.syntax } }
9000}
9001impl From<Enum> for AnyHasName {
9002 #[inline]
9003 fn from(node: Enum) -> AnyHasName { AnyHasName { syntax: node.syntax } }
9004}
9005impl From<Fn> for AnyHasName {
9006 #[inline]
9007 fn from(node: Fn) -> AnyHasName { AnyHasName { syntax: node.syntax } }
9008}
9009impl From<FormatArgsArg> for AnyHasName {
9010 #[inline]
9011 fn from(node: FormatArgsArg) -> AnyHasName { AnyHasName { syntax: node.syntax } }
9012}
9013impl From<IdentPat> for AnyHasName {
9014 #[inline]
9015 fn from(node: IdentPat) -> AnyHasName { AnyHasName { syntax: node.syntax } }
9016}
9017impl From<MacroDef> for AnyHasName {
9018 #[inline]
9019 fn from(node: MacroDef) -> AnyHasName { AnyHasName { syntax: node.syntax } }
9020}
9021impl From<MacroRules> for AnyHasName {
9022 #[inline]
9023 fn from(node: MacroRules) -> AnyHasName { AnyHasName { syntax: node.syntax } }
9024}
9025impl From<Module> for AnyHasName {
9026 #[inline]
9027 fn from(node: Module) -> AnyHasName { AnyHasName { syntax: node.syntax } }
9028}
9029impl From<RecordField> for AnyHasName {
9030 #[inline]
9031 fn from(node: RecordField) -> AnyHasName { AnyHasName { syntax: node.syntax } }
9032}
9033impl From<Rename> for AnyHasName {
9034 #[inline]
9035 fn from(node: Rename) -> AnyHasName { AnyHasName { syntax: node.syntax } }
9036}
9037impl From<SelfParam> for AnyHasName {
9038 #[inline]
9039 fn from(node: SelfParam) -> AnyHasName { AnyHasName { syntax: node.syntax } }
9040}
9041impl From<Static> for AnyHasName {
9042 #[inline]
9043 fn from(node: Static) -> AnyHasName { AnyHasName { syntax: node.syntax } }
9044}
9045impl From<Struct> for AnyHasName {
9046 #[inline]
9047 fn from(node: Struct) -> AnyHasName { AnyHasName { syntax: node.syntax } }
9048}
9049impl From<Trait> for AnyHasName {
9050 #[inline]
9051 fn from(node: Trait) -> AnyHasName { AnyHasName { syntax: node.syntax } }
9052}
9053impl From<TypeAlias> for AnyHasName {
9054 #[inline]
9055 fn from(node: TypeAlias) -> AnyHasName { AnyHasName { syntax: node.syntax } }
9056}
9057impl From<TypeParam> for AnyHasName {
9058 #[inline]
9059 fn from(node: TypeParam) -> AnyHasName { AnyHasName { syntax: node.syntax } }
9060}
9061impl From<Union> for AnyHasName {
9062 #[inline]
9063 fn from(node: Union) -> AnyHasName { AnyHasName { syntax: node.syntax } }
9064}
9065impl From<Variant> for AnyHasName {
9066 #[inline]
9067 fn from(node: Variant) -> AnyHasName { AnyHasName { syntax: node.syntax } }
9068}
9069impl ast::HasTypeBounds for AnyHasTypeBounds {}
9070impl AstNode for AnyHasTypeBounds {
9071 #[inline]
9072 fn can_cast(kind: SyntaxKind) -> bool {
9073 matches!(
9074 kind,
9075 ASSOC_TYPE_ARG | LIFETIME_PARAM | TRAIT | TYPE_ALIAS | TYPE_PARAM | WHERE_PRED
9076 )
9077 }
9078 #[inline]
9079 fn cast(syntax: SyntaxNode) -> Option<Self> {
9080 Self::can_cast(syntax.kind()).then_some(AnyHasTypeBounds { syntax })
9081 }
9082 #[inline]
9083 fn syntax(&self) -> &SyntaxNode { &self.syntax }
9084}
9085impl hash::Hash for AnyHasTypeBounds {
9086 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
9087}
9088impl Eq for AnyHasTypeBounds {}
9089impl PartialEq for AnyHasTypeBounds {
9090 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
9091}
9092impl Clone for AnyHasTypeBounds {
9093 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
9094}
9095impl fmt::Debug for AnyHasTypeBounds {
9096 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
9097 f.debug_struct("AnyHasTypeBounds").field("syntax", &self.syntax).finish()
9098 }
9099}
9100impl From<AssocTypeArg> for AnyHasTypeBounds {
9101 #[inline]
9102 fn from(node: AssocTypeArg) -> AnyHasTypeBounds { AnyHasTypeBounds { syntax: node.syntax } }
9103}
9104impl From<LifetimeParam> for AnyHasTypeBounds {
9105 #[inline]
9106 fn from(node: LifetimeParam) -> AnyHasTypeBounds { AnyHasTypeBounds { syntax: node.syntax } }
9107}
9108impl From<Trait> for AnyHasTypeBounds {
9109 #[inline]
9110 fn from(node: Trait) -> AnyHasTypeBounds { AnyHasTypeBounds { syntax: node.syntax } }
9111}
9112impl From<TypeAlias> for AnyHasTypeBounds {
9113 #[inline]
9114 fn from(node: TypeAlias) -> AnyHasTypeBounds { AnyHasTypeBounds { syntax: node.syntax } }
9115}
9116impl From<TypeParam> for AnyHasTypeBounds {
9117 #[inline]
9118 fn from(node: TypeParam) -> AnyHasTypeBounds { AnyHasTypeBounds { syntax: node.syntax } }
9119}
9120impl From<WherePred> for AnyHasTypeBounds {
9121 #[inline]
9122 fn from(node: WherePred) -> AnyHasTypeBounds { AnyHasTypeBounds { syntax: node.syntax } }
9123}
9124impl ast::HasVisibility for AnyHasVisibility {}
9125impl AstNode for AnyHasVisibility {
9126 #[inline]
9127 fn can_cast(kind: SyntaxKind) -> bool {
9128 matches!(
9129 kind,
9130 CONST
9131 | ENUM
9132 | EXTERN_CRATE
9133 | FN
9134 | IMPL
9135 | MACRO_DEF
9136 | MACRO_RULES
9137 | MODULE
9138 | RECORD_FIELD
9139 | STATIC
9140 | STRUCT
9141 | TRAIT
9142 | TUPLE_FIELD
9143 | TYPE_ALIAS
9144 | UNION
9145 | USE
9146 | VARIANT
9147 )
9148 }
9149 #[inline]
9150 fn cast(syntax: SyntaxNode) -> Option<Self> {
9151 Self::can_cast(syntax.kind()).then_some(AnyHasVisibility { syntax })
9152 }
9153 #[inline]
9154 fn syntax(&self) -> &SyntaxNode { &self.syntax }
9155}
9156impl hash::Hash for AnyHasVisibility {
9157 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
9158}
9159impl Eq for AnyHasVisibility {}
9160impl PartialEq for AnyHasVisibility {
9161 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
9162}
9163impl Clone for AnyHasVisibility {
9164 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
9165}
9166impl fmt::Debug for AnyHasVisibility {
9167 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
9168 f.debug_struct("AnyHasVisibility").field("syntax", &self.syntax).finish()
9169 }
9170}
9171impl From<Const> for AnyHasVisibility {
9172 #[inline]
9173 fn from(node: Const) -> AnyHasVisibility { AnyHasVisibility { syntax: node.syntax } }
9174}
9175impl From<Enum> for AnyHasVisibility {
9176 #[inline]
9177 fn from(node: Enum) -> AnyHasVisibility { AnyHasVisibility { syntax: node.syntax } }
9178}
9179impl From<ExternCrate> for AnyHasVisibility {
9180 #[inline]
9181 fn from(node: ExternCrate) -> AnyHasVisibility { AnyHasVisibility { syntax: node.syntax } }
9182}
9183impl From<Fn> for AnyHasVisibility {
9184 #[inline]
9185 fn from(node: Fn) -> AnyHasVisibility { AnyHasVisibility { syntax: node.syntax } }
9186}
9187impl From<Impl> for AnyHasVisibility {
9188 #[inline]
9189 fn from(node: Impl) -> AnyHasVisibility { AnyHasVisibility { syntax: node.syntax } }
9190}
9191impl From<MacroDef> for AnyHasVisibility {
9192 #[inline]
9193 fn from(node: MacroDef) -> AnyHasVisibility { AnyHasVisibility { syntax: node.syntax } }
9194}
9195impl From<MacroRules> for AnyHasVisibility {
9196 #[inline]
9197 fn from(node: MacroRules) -> AnyHasVisibility { AnyHasVisibility { syntax: node.syntax } }
9198}
9199impl From<Module> for AnyHasVisibility {
9200 #[inline]
9201 fn from(node: Module) -> AnyHasVisibility { AnyHasVisibility { syntax: node.syntax } }
9202}
9203impl From<RecordField> for AnyHasVisibility {
9204 #[inline]
9205 fn from(node: RecordField) -> AnyHasVisibility { AnyHasVisibility { syntax: node.syntax } }
9206}
9207impl From<Static> for AnyHasVisibility {
9208 #[inline]
9209 fn from(node: Static) -> AnyHasVisibility { AnyHasVisibility { syntax: node.syntax } }
9210}
9211impl From<Struct> for AnyHasVisibility {
9212 #[inline]
9213 fn from(node: Struct) -> AnyHasVisibility { AnyHasVisibility { syntax: node.syntax } }
9214}
9215impl From<Trait> for AnyHasVisibility {
9216 #[inline]
9217 fn from(node: Trait) -> AnyHasVisibility { AnyHasVisibility { syntax: node.syntax } }
9218}
9219impl From<TupleField> for AnyHasVisibility {
9220 #[inline]
9221 fn from(node: TupleField) -> AnyHasVisibility { AnyHasVisibility { syntax: node.syntax } }
9222}
9223impl From<TypeAlias> for AnyHasVisibility {
9224 #[inline]
9225 fn from(node: TypeAlias) -> AnyHasVisibility { AnyHasVisibility { syntax: node.syntax } }
9226}
9227impl From<Union> for AnyHasVisibility {
9228 #[inline]
9229 fn from(node: Union) -> AnyHasVisibility { AnyHasVisibility { syntax: node.syntax } }
9230}
9231impl From<Use> for AnyHasVisibility {
9232 #[inline]
9233 fn from(node: Use) -> AnyHasVisibility { AnyHasVisibility { syntax: node.syntax } }
9234}
9235impl From<Variant> for AnyHasVisibility {
9236 #[inline]
9237 fn from(node: Variant) -> AnyHasVisibility { AnyHasVisibility { syntax: node.syntax } }
9238}
9239impl std::fmt::Display for Adt {
9240 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9241 std::fmt::Display::fmt(self.syntax(), f)
9242 }
9243}
9244impl std::fmt::Display for AsmOperand {
9245 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9246 std::fmt::Display::fmt(self.syntax(), f)
9247 }
9248}
9249impl std::fmt::Display for AsmPiece {
9250 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9251 std::fmt::Display::fmt(self.syntax(), f)
9252 }
9253}
9254impl std::fmt::Display for AssocItem {
9255 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9256 std::fmt::Display::fmt(self.syntax(), f)
9257 }
9258}
9259impl std::fmt::Display for Expr {
9260 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9261 std::fmt::Display::fmt(self.syntax(), f)
9262 }
9263}
9264impl std::fmt::Display for ExternItem {
9265 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9266 std::fmt::Display::fmt(self.syntax(), f)
9267 }
9268}
9269impl std::fmt::Display for FieldList {
9270 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9271 std::fmt::Display::fmt(self.syntax(), f)
9272 }
9273}
9274impl std::fmt::Display for GenericArg {
9275 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9276 std::fmt::Display::fmt(self.syntax(), f)
9277 }
9278}
9279impl std::fmt::Display for GenericParam {
9280 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9281 std::fmt::Display::fmt(self.syntax(), f)
9282 }
9283}
9284impl std::fmt::Display for Item {
9285 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9286 std::fmt::Display::fmt(self.syntax(), f)
9287 }
9288}
9289impl std::fmt::Display for Pat {
9290 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9291 std::fmt::Display::fmt(self.syntax(), f)
9292 }
9293}
9294impl std::fmt::Display for Stmt {
9295 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9296 std::fmt::Display::fmt(self.syntax(), f)
9297 }
9298}
9299impl std::fmt::Display for Type {
9300 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9301 std::fmt::Display::fmt(self.syntax(), f)
9302 }
9303}
9304impl std::fmt::Display for UseBoundGenericArg {
9305 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9306 std::fmt::Display::fmt(self.syntax(), f)
9307 }
9308}
9309impl std::fmt::Display for VariantDef {
9310 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9311 std::fmt::Display::fmt(self.syntax(), f)
9312 }
9313}
9314impl std::fmt::Display for Abi {
9315 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9316 std::fmt::Display::fmt(self.syntax(), f)
9317 }
9318}
9319impl std::fmt::Display for ArgList {
9320 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9321 std::fmt::Display::fmt(self.syntax(), f)
9322 }
9323}
9324impl std::fmt::Display for ArrayExpr {
9325 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9326 std::fmt::Display::fmt(self.syntax(), f)
9327 }
9328}
9329impl std::fmt::Display for ArrayType {
9330 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9331 std::fmt::Display::fmt(self.syntax(), f)
9332 }
9333}
9334impl std::fmt::Display for AsmClobberAbi {
9335 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9336 std::fmt::Display::fmt(self.syntax(), f)
9337 }
9338}
9339impl std::fmt::Display for AsmConst {
9340 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9341 std::fmt::Display::fmt(self.syntax(), f)
9342 }
9343}
9344impl std::fmt::Display for AsmDirSpec {
9345 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9346 std::fmt::Display::fmt(self.syntax(), f)
9347 }
9348}
9349impl std::fmt::Display for AsmExpr {
9350 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9351 std::fmt::Display::fmt(self.syntax(), f)
9352 }
9353}
9354impl std::fmt::Display for AsmLabel {
9355 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9356 std::fmt::Display::fmt(self.syntax(), f)
9357 }
9358}
9359impl std::fmt::Display for AsmOperandExpr {
9360 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9361 std::fmt::Display::fmt(self.syntax(), f)
9362 }
9363}
9364impl std::fmt::Display for AsmOperandNamed {
9365 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9366 std::fmt::Display::fmt(self.syntax(), f)
9367 }
9368}
9369impl std::fmt::Display for AsmOption {
9370 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9371 std::fmt::Display::fmt(self.syntax(), f)
9372 }
9373}
9374impl std::fmt::Display for AsmOptions {
9375 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9376 std::fmt::Display::fmt(self.syntax(), f)
9377 }
9378}
9379impl std::fmt::Display for AsmRegOperand {
9380 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9381 std::fmt::Display::fmt(self.syntax(), f)
9382 }
9383}
9384impl std::fmt::Display for AsmRegSpec {
9385 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9386 std::fmt::Display::fmt(self.syntax(), f)
9387 }
9388}
9389impl std::fmt::Display for AsmSym {
9390 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9391 std::fmt::Display::fmt(self.syntax(), f)
9392 }
9393}
9394impl std::fmt::Display for AssocItemList {
9395 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9396 std::fmt::Display::fmt(self.syntax(), f)
9397 }
9398}
9399impl std::fmt::Display for AssocTypeArg {
9400 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9401 std::fmt::Display::fmt(self.syntax(), f)
9402 }
9403}
9404impl std::fmt::Display for Attr {
9405 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9406 std::fmt::Display::fmt(self.syntax(), f)
9407 }
9408}
9409impl std::fmt::Display for AwaitExpr {
9410 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9411 std::fmt::Display::fmt(self.syntax(), f)
9412 }
9413}
9414impl std::fmt::Display for BecomeExpr {
9415 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9416 std::fmt::Display::fmt(self.syntax(), f)
9417 }
9418}
9419impl std::fmt::Display for BinExpr {
9420 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9421 std::fmt::Display::fmt(self.syntax(), f)
9422 }
9423}
9424impl std::fmt::Display for BlockExpr {
9425 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9426 std::fmt::Display::fmt(self.syntax(), f)
9427 }
9428}
9429impl std::fmt::Display for BoxPat {
9430 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9431 std::fmt::Display::fmt(self.syntax(), f)
9432 }
9433}
9434impl std::fmt::Display for BreakExpr {
9435 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9436 std::fmt::Display::fmt(self.syntax(), f)
9437 }
9438}
9439impl std::fmt::Display for CallExpr {
9440 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9441 std::fmt::Display::fmt(self.syntax(), f)
9442 }
9443}
9444impl std::fmt::Display for CastExpr {
9445 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9446 std::fmt::Display::fmt(self.syntax(), f)
9447 }
9448}
9449impl std::fmt::Display for ClosureExpr {
9450 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9451 std::fmt::Display::fmt(self.syntax(), f)
9452 }
9453}
9454impl std::fmt::Display for Const {
9455 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9456 std::fmt::Display::fmt(self.syntax(), f)
9457 }
9458}
9459impl std::fmt::Display for ConstArg {
9460 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9461 std::fmt::Display::fmt(self.syntax(), f)
9462 }
9463}
9464impl std::fmt::Display for ConstBlockPat {
9465 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9466 std::fmt::Display::fmt(self.syntax(), f)
9467 }
9468}
9469impl std::fmt::Display for ConstParam {
9470 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9471 std::fmt::Display::fmt(self.syntax(), f)
9472 }
9473}
9474impl std::fmt::Display for ContinueExpr {
9475 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9476 std::fmt::Display::fmt(self.syntax(), f)
9477 }
9478}
9479impl std::fmt::Display for DynTraitType {
9480 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9481 std::fmt::Display::fmt(self.syntax(), f)
9482 }
9483}
9484impl std::fmt::Display for Enum {
9485 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9486 std::fmt::Display::fmt(self.syntax(), f)
9487 }
9488}
9489impl std::fmt::Display for ExprStmt {
9490 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9491 std::fmt::Display::fmt(self.syntax(), f)
9492 }
9493}
9494impl std::fmt::Display for ExternBlock {
9495 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9496 std::fmt::Display::fmt(self.syntax(), f)
9497 }
9498}
9499impl std::fmt::Display for ExternCrate {
9500 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9501 std::fmt::Display::fmt(self.syntax(), f)
9502 }
9503}
9504impl std::fmt::Display for ExternItemList {
9505 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9506 std::fmt::Display::fmt(self.syntax(), f)
9507 }
9508}
9509impl std::fmt::Display for FieldExpr {
9510 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9511 std::fmt::Display::fmt(self.syntax(), f)
9512 }
9513}
9514impl std::fmt::Display for Fn {
9515 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9516 std::fmt::Display::fmt(self.syntax(), f)
9517 }
9518}
9519impl std::fmt::Display for FnPtrType {
9520 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9521 std::fmt::Display::fmt(self.syntax(), f)
9522 }
9523}
9524impl std::fmt::Display for ForBinder {
9525 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9526 std::fmt::Display::fmt(self.syntax(), f)
9527 }
9528}
9529impl std::fmt::Display for ForExpr {
9530 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9531 std::fmt::Display::fmt(self.syntax(), f)
9532 }
9533}
9534impl std::fmt::Display for ForType {
9535 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9536 std::fmt::Display::fmt(self.syntax(), f)
9537 }
9538}
9539impl std::fmt::Display for FormatArgsArg {
9540 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9541 std::fmt::Display::fmt(self.syntax(), f)
9542 }
9543}
9544impl std::fmt::Display for FormatArgsExpr {
9545 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9546 std::fmt::Display::fmt(self.syntax(), f)
9547 }
9548}
9549impl std::fmt::Display for GenericArgList {
9550 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9551 std::fmt::Display::fmt(self.syntax(), f)
9552 }
9553}
9554impl std::fmt::Display for GenericParamList {
9555 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9556 std::fmt::Display::fmt(self.syntax(), f)
9557 }
9558}
9559impl std::fmt::Display for IdentPat {
9560 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9561 std::fmt::Display::fmt(self.syntax(), f)
9562 }
9563}
9564impl std::fmt::Display for IfExpr {
9565 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9566 std::fmt::Display::fmt(self.syntax(), f)
9567 }
9568}
9569impl std::fmt::Display for Impl {
9570 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9571 std::fmt::Display::fmt(self.syntax(), f)
9572 }
9573}
9574impl std::fmt::Display for ImplTraitType {
9575 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9576 std::fmt::Display::fmt(self.syntax(), f)
9577 }
9578}
9579impl std::fmt::Display for IndexExpr {
9580 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9581 std::fmt::Display::fmt(self.syntax(), f)
9582 }
9583}
9584impl std::fmt::Display for InferType {
9585 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9586 std::fmt::Display::fmt(self.syntax(), f)
9587 }
9588}
9589impl std::fmt::Display for ItemList {
9590 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9591 std::fmt::Display::fmt(self.syntax(), f)
9592 }
9593}
9594impl std::fmt::Display for Label {
9595 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9596 std::fmt::Display::fmt(self.syntax(), f)
9597 }
9598}
9599impl std::fmt::Display for LetElse {
9600 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9601 std::fmt::Display::fmt(self.syntax(), f)
9602 }
9603}
9604impl std::fmt::Display for LetExpr {
9605 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9606 std::fmt::Display::fmt(self.syntax(), f)
9607 }
9608}
9609impl std::fmt::Display for LetStmt {
9610 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9611 std::fmt::Display::fmt(self.syntax(), f)
9612 }
9613}
9614impl std::fmt::Display for Lifetime {
9615 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9616 std::fmt::Display::fmt(self.syntax(), f)
9617 }
9618}
9619impl std::fmt::Display for LifetimeArg {
9620 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9621 std::fmt::Display::fmt(self.syntax(), f)
9622 }
9623}
9624impl std::fmt::Display for LifetimeParam {
9625 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9626 std::fmt::Display::fmt(self.syntax(), f)
9627 }
9628}
9629impl std::fmt::Display for Literal {
9630 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9631 std::fmt::Display::fmt(self.syntax(), f)
9632 }
9633}
9634impl std::fmt::Display for LiteralPat {
9635 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9636 std::fmt::Display::fmt(self.syntax(), f)
9637 }
9638}
9639impl std::fmt::Display for LoopExpr {
9640 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9641 std::fmt::Display::fmt(self.syntax(), f)
9642 }
9643}
9644impl std::fmt::Display for MacroCall {
9645 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9646 std::fmt::Display::fmt(self.syntax(), f)
9647 }
9648}
9649impl std::fmt::Display for MacroDef {
9650 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9651 std::fmt::Display::fmt(self.syntax(), f)
9652 }
9653}
9654impl std::fmt::Display for MacroExpr {
9655 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9656 std::fmt::Display::fmt(self.syntax(), f)
9657 }
9658}
9659impl std::fmt::Display for MacroItems {
9660 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9661 std::fmt::Display::fmt(self.syntax(), f)
9662 }
9663}
9664impl std::fmt::Display for MacroPat {
9665 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9666 std::fmt::Display::fmt(self.syntax(), f)
9667 }
9668}
9669impl std::fmt::Display for MacroRules {
9670 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9671 std::fmt::Display::fmt(self.syntax(), f)
9672 }
9673}
9674impl std::fmt::Display for MacroStmts {
9675 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9676 std::fmt::Display::fmt(self.syntax(), f)
9677 }
9678}
9679impl std::fmt::Display for MacroType {
9680 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9681 std::fmt::Display::fmt(self.syntax(), f)
9682 }
9683}
9684impl std::fmt::Display for MatchArm {
9685 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9686 std::fmt::Display::fmt(self.syntax(), f)
9687 }
9688}
9689impl std::fmt::Display for MatchArmList {
9690 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9691 std::fmt::Display::fmt(self.syntax(), f)
9692 }
9693}
9694impl std::fmt::Display for MatchExpr {
9695 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9696 std::fmt::Display::fmt(self.syntax(), f)
9697 }
9698}
9699impl std::fmt::Display for MatchGuard {
9700 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9701 std::fmt::Display::fmt(self.syntax(), f)
9702 }
9703}
9704impl std::fmt::Display for Meta {
9705 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9706 std::fmt::Display::fmt(self.syntax(), f)
9707 }
9708}
9709impl std::fmt::Display for MethodCallExpr {
9710 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9711 std::fmt::Display::fmt(self.syntax(), f)
9712 }
9713}
9714impl std::fmt::Display for Module {
9715 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9716 std::fmt::Display::fmt(self.syntax(), f)
9717 }
9718}
9719impl std::fmt::Display for Name {
9720 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9721 std::fmt::Display::fmt(self.syntax(), f)
9722 }
9723}
9724impl std::fmt::Display for NameRef {
9725 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9726 std::fmt::Display::fmt(self.syntax(), f)
9727 }
9728}
9729impl std::fmt::Display for NeverType {
9730 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9731 std::fmt::Display::fmt(self.syntax(), f)
9732 }
9733}
9734impl std::fmt::Display for OffsetOfExpr {
9735 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9736 std::fmt::Display::fmt(self.syntax(), f)
9737 }
9738}
9739impl std::fmt::Display for OrPat {
9740 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9741 std::fmt::Display::fmt(self.syntax(), f)
9742 }
9743}
9744impl std::fmt::Display for Param {
9745 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9746 std::fmt::Display::fmt(self.syntax(), f)
9747 }
9748}
9749impl std::fmt::Display for ParamList {
9750 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9751 std::fmt::Display::fmt(self.syntax(), f)
9752 }
9753}
9754impl std::fmt::Display for ParenExpr {
9755 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9756 std::fmt::Display::fmt(self.syntax(), f)
9757 }
9758}
9759impl std::fmt::Display for ParenPat {
9760 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9761 std::fmt::Display::fmt(self.syntax(), f)
9762 }
9763}
9764impl std::fmt::Display for ParenType {
9765 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9766 std::fmt::Display::fmt(self.syntax(), f)
9767 }
9768}
9769impl std::fmt::Display for ParenthesizedArgList {
9770 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9771 std::fmt::Display::fmt(self.syntax(), f)
9772 }
9773}
9774impl std::fmt::Display for Path {
9775 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9776 std::fmt::Display::fmt(self.syntax(), f)
9777 }
9778}
9779impl std::fmt::Display for PathExpr {
9780 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9781 std::fmt::Display::fmt(self.syntax(), f)
9782 }
9783}
9784impl std::fmt::Display for PathPat {
9785 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9786 std::fmt::Display::fmt(self.syntax(), f)
9787 }
9788}
9789impl std::fmt::Display for PathSegment {
9790 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9791 std::fmt::Display::fmt(self.syntax(), f)
9792 }
9793}
9794impl std::fmt::Display for PathType {
9795 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9796 std::fmt::Display::fmt(self.syntax(), f)
9797 }
9798}
9799impl std::fmt::Display for PrefixExpr {
9800 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9801 std::fmt::Display::fmt(self.syntax(), f)
9802 }
9803}
9804impl std::fmt::Display for PtrType {
9805 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9806 std::fmt::Display::fmt(self.syntax(), f)
9807 }
9808}
9809impl std::fmt::Display for RangeExpr {
9810 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9811 std::fmt::Display::fmt(self.syntax(), f)
9812 }
9813}
9814impl std::fmt::Display for RangePat {
9815 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9816 std::fmt::Display::fmt(self.syntax(), f)
9817 }
9818}
9819impl std::fmt::Display for RecordExpr {
9820 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9821 std::fmt::Display::fmt(self.syntax(), f)
9822 }
9823}
9824impl std::fmt::Display for RecordExprField {
9825 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9826 std::fmt::Display::fmt(self.syntax(), f)
9827 }
9828}
9829impl std::fmt::Display for RecordExprFieldList {
9830 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9831 std::fmt::Display::fmt(self.syntax(), f)
9832 }
9833}
9834impl std::fmt::Display for RecordField {
9835 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9836 std::fmt::Display::fmt(self.syntax(), f)
9837 }
9838}
9839impl std::fmt::Display for RecordFieldList {
9840 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9841 std::fmt::Display::fmt(self.syntax(), f)
9842 }
9843}
9844impl std::fmt::Display for RecordPat {
9845 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9846 std::fmt::Display::fmt(self.syntax(), f)
9847 }
9848}
9849impl std::fmt::Display for RecordPatField {
9850 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9851 std::fmt::Display::fmt(self.syntax(), f)
9852 }
9853}
9854impl std::fmt::Display for RecordPatFieldList {
9855 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9856 std::fmt::Display::fmt(self.syntax(), f)
9857 }
9858}
9859impl std::fmt::Display for RefExpr {
9860 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9861 std::fmt::Display::fmt(self.syntax(), f)
9862 }
9863}
9864impl std::fmt::Display for RefPat {
9865 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9866 std::fmt::Display::fmt(self.syntax(), f)
9867 }
9868}
9869impl std::fmt::Display for RefType {
9870 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9871 std::fmt::Display::fmt(self.syntax(), f)
9872 }
9873}
9874impl std::fmt::Display for Rename {
9875 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9876 std::fmt::Display::fmt(self.syntax(), f)
9877 }
9878}
9879impl std::fmt::Display for RestPat {
9880 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9881 std::fmt::Display::fmt(self.syntax(), f)
9882 }
9883}
9884impl std::fmt::Display for RetType {
9885 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9886 std::fmt::Display::fmt(self.syntax(), f)
9887 }
9888}
9889impl std::fmt::Display for ReturnExpr {
9890 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9891 std::fmt::Display::fmt(self.syntax(), f)
9892 }
9893}
9894impl std::fmt::Display for ReturnTypeSyntax {
9895 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9896 std::fmt::Display::fmt(self.syntax(), f)
9897 }
9898}
9899impl std::fmt::Display for SelfParam {
9900 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9901 std::fmt::Display::fmt(self.syntax(), f)
9902 }
9903}
9904impl std::fmt::Display for SlicePat {
9905 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9906 std::fmt::Display::fmt(self.syntax(), f)
9907 }
9908}
9909impl std::fmt::Display for SliceType {
9910 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9911 std::fmt::Display::fmt(self.syntax(), f)
9912 }
9913}
9914impl std::fmt::Display for SourceFile {
9915 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9916 std::fmt::Display::fmt(self.syntax(), f)
9917 }
9918}
9919impl std::fmt::Display for Static {
9920 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9921 std::fmt::Display::fmt(self.syntax(), f)
9922 }
9923}
9924impl std::fmt::Display for StmtList {
9925 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9926 std::fmt::Display::fmt(self.syntax(), f)
9927 }
9928}
9929impl std::fmt::Display for Struct {
9930 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9931 std::fmt::Display::fmt(self.syntax(), f)
9932 }
9933}
9934impl std::fmt::Display for TokenTree {
9935 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9936 std::fmt::Display::fmt(self.syntax(), f)
9937 }
9938}
9939impl std::fmt::Display for Trait {
9940 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9941 std::fmt::Display::fmt(self.syntax(), f)
9942 }
9943}
9944impl std::fmt::Display for TryExpr {
9945 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9946 std::fmt::Display::fmt(self.syntax(), f)
9947 }
9948}
9949impl std::fmt::Display for TupleExpr {
9950 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9951 std::fmt::Display::fmt(self.syntax(), f)
9952 }
9953}
9954impl std::fmt::Display for TupleField {
9955 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9956 std::fmt::Display::fmt(self.syntax(), f)
9957 }
9958}
9959impl std::fmt::Display for TupleFieldList {
9960 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9961 std::fmt::Display::fmt(self.syntax(), f)
9962 }
9963}
9964impl std::fmt::Display for TuplePat {
9965 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9966 std::fmt::Display::fmt(self.syntax(), f)
9967 }
9968}
9969impl std::fmt::Display for TupleStructPat {
9970 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9971 std::fmt::Display::fmt(self.syntax(), f)
9972 }
9973}
9974impl std::fmt::Display for TupleType {
9975 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9976 std::fmt::Display::fmt(self.syntax(), f)
9977 }
9978}
9979impl std::fmt::Display for TypeAlias {
9980 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9981 std::fmt::Display::fmt(self.syntax(), f)
9982 }
9983}
9984impl std::fmt::Display for TypeAnchor {
9985 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9986 std::fmt::Display::fmt(self.syntax(), f)
9987 }
9988}
9989impl std::fmt::Display for TypeArg {
9990 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9991 std::fmt::Display::fmt(self.syntax(), f)
9992 }
9993}
9994impl std::fmt::Display for TypeBound {
9995 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9996 std::fmt::Display::fmt(self.syntax(), f)
9997 }
9998}
9999impl std::fmt::Display for TypeBoundList {
10000 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10001 std::fmt::Display::fmt(self.syntax(), f)
10002 }
10003}
10004impl std::fmt::Display for TypeParam {
10005 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10006 std::fmt::Display::fmt(self.syntax(), f)
10007 }
10008}
10009impl std::fmt::Display for UnderscoreExpr {
10010 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10011 std::fmt::Display::fmt(self.syntax(), f)
10012 }
10013}
10014impl std::fmt::Display for Union {
10015 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10016 std::fmt::Display::fmt(self.syntax(), f)
10017 }
10018}
10019impl std::fmt::Display for Use {
10020 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10021 std::fmt::Display::fmt(self.syntax(), f)
10022 }
10023}
10024impl std::fmt::Display for UseBoundGenericArgs {
10025 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10026 std::fmt::Display::fmt(self.syntax(), f)
10027 }
10028}
10029impl std::fmt::Display for UseTree {
10030 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10031 std::fmt::Display::fmt(self.syntax(), f)
10032 }
10033}
10034impl std::fmt::Display for UseTreeList {
10035 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10036 std::fmt::Display::fmt(self.syntax(), f)
10037 }
10038}
10039impl std::fmt::Display for Variant {
10040 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10041 std::fmt::Display::fmt(self.syntax(), f)
10042 }
10043}
10044impl std::fmt::Display for VariantList {
10045 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10046 std::fmt::Display::fmt(self.syntax(), f)
10047 }
10048}
10049impl std::fmt::Display for Visibility {
10050 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10051 std::fmt::Display::fmt(self.syntax(), f)
10052 }
10053}
10054impl std::fmt::Display for WhereClause {
10055 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10056 std::fmt::Display::fmt(self.syntax(), f)
10057 }
10058}
10059impl std::fmt::Display for WherePred {
10060 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10061 std::fmt::Display::fmt(self.syntax(), f)
10062 }
10063}
10064impl std::fmt::Display for WhileExpr {
10065 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10066 std::fmt::Display::fmt(self.syntax(), f)
10067 }
10068}
10069impl std::fmt::Display for WildcardPat {
10070 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10071 std::fmt::Display::fmt(self.syntax(), f)
10072 }
10073}
10074impl std::fmt::Display for YeetExpr {
10075 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10076 std::fmt::Display::fmt(self.syntax(), f)
10077 }
10078}
10079impl std::fmt::Display for YieldExpr {
10080 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10081 std::fmt::Display::fmt(self.syntax(), f)
10082 }
10083}