Skip to main content

rustidy_ast/expr/without_block/
await_.rs

1//! Await
2
3// Imports
4use {
5	crate::{expr::{Expression, ExpressionInner}, token},
6	super::ExpressionWithoutBlockInner,
7	rustidy_format::{Format, Formattable, WhitespaceFormat},
8	rustidy_parse::ParseRecursive,
9	rustidy_print::Print,
10	rustidy_util::Whitespace,
11};
12
13/// `AwaitExpression`
14#[derive(PartialEq, Eq, Clone, Debug)]
15#[derive(serde::Serialize, serde::Deserialize)]
16#[derive(ParseRecursive, Formattable, Format, Print)]
17#[parse_recursive(root = ExpressionInner)]
18#[parse_recursive(into_root = ExpressionWithoutBlockInner)]
19#[parse_recursive(kind = "left")]
20pub struct AwaitExpression {
21	pub expr:   Expression,
22	#[format(prefix_ws = Whitespace::REMOVE)]
23	pub dot:    token::Dot,
24	#[format(prefix_ws = Whitespace::REMOVE)]
25	pub await_: token::Await,
26}