Skip to main content

rustidy_ast/ty/
qualified.rs

1//! Qualified path in
2
3// Imports
4use {
5	crate::{expr::without_block::path::QualifiedPathType, token},
6	super::path::TypePathSegment,
7	rustidy_ast_util::{AtLeast1, at_least},
8	rustidy_format::{Format, Formattable, WhitespaceFormat},
9	rustidy_parse::Parse,
10	rustidy_print::Print,
11	rustidy_util::Whitespace,
12};
13
14/// `QualifiedPathInType`
15#[derive(PartialEq, Eq, Clone, Debug)]
16#[derive(serde::Serialize, serde::Deserialize)]
17#[derive(Parse, Formattable, Format, Print)]
18pub struct QualifiedPathInType {
19	pub qualified: QualifiedPathType,
20	#[format(prefix_ws = Whitespace::REMOVE)]
21	#[format(args = at_least::fmt_prefix_ws(Whitespace::REMOVE))]
22	pub segments:  AtLeast1<QualifiedPathInTypeSegment>,
23}
24
25#[derive(PartialEq, Eq, Clone, Debug)]
26#[derive(serde::Serialize, serde::Deserialize)]
27#[derive(Parse, Formattable, Format, Print)]
28pub struct QualifiedPathInTypeSegment {
29	pub sep:     token::PathSep,
30	#[format(prefix_ws = Whitespace::REMOVE)]
31	pub segment: TypePathSegment,
32}