Skip to main content

icydb/base/types/
ident.rs

1use crate::design::prelude::*;
2
3///
4/// Constant
5///
6
7#[newtype(
8    primitive = "Text",
9    item(prim = "Text"),
10    ty(
11        validator(path = "base::validator::len::Range", args(1, 40)),
12        validator(path = "base::validator::text::case::UpperSnake"),
13    )
14)]
15pub struct Constant {}
16
17///
18/// Field
19///
20
21#[newtype(
22    primitive = "Text",
23    item(prim = "Text"),
24    ty(
25        validator(path = "base::validator::len::Range", args(2, 40)),
26        validator(path = "base::validator::text::case::Snake"),
27    )
28)]
29pub struct Field {}
30
31///
32/// Function
33///
34/// 30 characters, snake_case
35///
36
37#[newtype(
38    primitive = "Text",
39    item(prim = "Text"),
40    ty(
41        validator(path = "base::validator::len::Range", args(2, 64)),
42        validator(path = "base::validator::text::case::Snake"),
43    )
44)]
45pub struct Function {}
46
47///
48/// Variable
49///
50
51#[newtype(
52    primitive = "Text",
53    item(prim = "Text"),
54    ty(
55        validator(path = "base::validator::len::Range", args(2, 40)),
56        validator(path = "base::validator::text::case::Snake"),
57    )
58)]
59pub struct Variable {}
60
61///
62/// Variant
63///
64
65#[newtype(
66    primitive = "Text",
67    item(prim = "Text"),
68    ty(
69        validator(path = "base::validator::len::Range", args(1, 40)),
70        validator(path = "base::validator::text::case::UpperCamel"),
71    )
72)]
73pub struct Variant {}