Skip to main content

rustidy_ast/ty/
pointer.rs

1//! Tuple type
2
3// Imports
4use {
5	crate::token,
6	super::TypeNoBounds,
7	rustidy_format::{Format, Formattable, WhitespaceFormat},
8	rustidy_parse::Parse,
9	rustidy_print::Print,
10	rustidy_util::Whitespace,
11};
12
13/// `RawPointerType`
14#[derive(PartialEq, Eq, Clone, Debug)]
15#[derive(serde::Serialize, serde::Deserialize)]
16#[derive(Parse, Formattable, Format, Print)]
17pub struct RawPointerType {
18	pub star: token::Star,
19	#[format(prefix_ws = Whitespace::REMOVE)]
20	pub kind: RawPointerTypeKind,
21	#[format(prefix_ws = Whitespace::SINGLE)]
22	pub ty:   Box<TypeNoBounds>,
23}
24
25#[derive(PartialEq, Eq, Clone, Debug)]
26#[derive(serde::Serialize, serde::Deserialize)]
27#[derive(Parse, Formattable, Format, Print)]
28pub enum RawPointerTypeKind {
29	Const(token::Const),
30	Mut(token::Mut),
31}