Users/
Identifiers.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
use std::ops::{Add, AddAssign};

pub type User_identifier_inner_type = u16;

#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, Ord, PartialOrd)]
#[repr(transparent)]
pub struct User_identifier_type(User_identifier_inner_type);

impl User_identifier_type {
    pub const Root: Self = Self::New(0);

    pub const Minimum: Self = Self::New(1);
    pub const Maximum: Self = Self::New(User_identifier_inner_type::MAX);

    pub const fn New(Identifier: User_identifier_inner_type) -> Self {
        Self(Identifier)
    }

    pub const fn As_u16(self) -> User_identifier_inner_type {
        self.0
    }
}

impl AddAssign<User_identifier_inner_type> for User_identifier_type {
    fn add_assign(&mut self, Other: User_identifier_inner_type) {
        self.0 += Other;
    }
}

impl Add<User_identifier_inner_type> for User_identifier_type {
    type Output = Self;

    fn add(self, Other: User_identifier_inner_type) -> Self {
        Self::New(self.0 + Other)
    }
}

impl From<User_identifier_inner_type> for User_identifier_type {
    fn from(Value: User_identifier_inner_type) -> Self {
        User_identifier_type::New(Value)
    }
}
impl From<User_identifier_type> for User_identifier_inner_type {
    fn from(Value: User_identifier_type) -> Self {
        Value.As_u16()
    }
}

pub type Group_identifier_inner_type = u16;

#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, Ord, PartialOrd)]
#[repr(transparent)]
pub struct Group_identifier_type(Group_identifier_inner_type);

impl Group_identifier_type {
    pub const Root: Self = Self::New(0);

    pub const Minimum: Self = Self::New(1);
    pub const Maximum: Self = Self::New(Group_identifier_inner_type::MAX);

    pub const fn New(Identifier: Group_identifier_inner_type) -> Self {
        Self(Identifier)
    }

    pub const fn As_u16(self) -> Group_identifier_inner_type {
        self.0
    }
}

impl From<Group_identifier_inner_type> for Group_identifier_type {
    fn from(Value: Group_identifier_inner_type) -> Self {
        Group_identifier_type::New(Value)
    }
}
impl From<Group_identifier_type> for Group_identifier_inner_type {
    fn from(Value: Group_identifier_type) -> Self {
        Value.As_u16()
    }
}

impl AddAssign<Group_identifier_inner_type> for Group_identifier_type {
    fn add_assign(&mut self, Other: Group_identifier_inner_type) {
        self.0 += Other;
    }
}

impl Add<Group_identifier_inner_type> for Group_identifier_type {
    type Output = Self;

    fn add(self, Other: Group_identifier_inner_type) -> Self {
        Self::New(self.0 + Other)
    }
}