forked from argotorg/fe
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathops.fe
More file actions
183 lines (136 loc) · 3.53 KB
/
Copy pathops.fe
File metadata and controls
183 lines (136 loc) · 3.53 KB
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
pub trait Add<T = Self> {
type Output = Self
fn add(own self, _ other: own T) -> Self::Output
}
// Arithmetic binary operators
pub trait Sub<T = Self> {
type Output = Self
fn sub(own self, _ other: own T) -> Self::Output
}
pub trait Mul<T = Self> {
type Output = Self
fn mul(own self, _ other: own T) -> Self::Output
}
pub trait Div<T = Self> {
type Output = Self
fn div(own self, _ other: own T) -> Self::Output
}
pub trait Rem<T = Self> {
type Output = Self
fn rem(own self, _ other: own T) -> Self::Output
}
pub trait Pow<T = Self> {
type Output = Self
fn pow(own self, _ other: own T) -> Self::Output
}
// Explicit overflow behavior (opt-in)
pub trait WrappingAdd<T = Self> {
type Output = Self
fn wrapping_add(self, _ other: T) -> Self::Output
}
pub trait WrappingSub<T = Self> {
type Output = Self
fn wrapping_sub(self, _ other: T) -> Self::Output
}
pub trait WrappingMul<T = Self> {
type Output = Self
fn wrapping_mul(self, _ other: T) -> Self::Output
}
pub trait SaturatingAdd<T = Self> {
type Output = Self
fn saturating_add(self, _ other: T) -> Self::Output
}
pub trait SaturatingSub<T = Self> {
type Output = Self
fn saturating_sub(self, _ other: T) -> Self::Output
}
pub trait SaturatingMul<T = Self> {
type Output = Self
fn saturating_mul(self, _ other: T) -> Self::Output
}
// Bitwise binary operators
pub trait BitAnd<T = Self> {
type Output = Self
fn bitand(own self, _ other: own T) -> Self::Output
}
pub trait BitOr<T = Self> {
type Output = Self
fn bitor(own self, _ other: own T) -> Self::Output
}
pub trait BitXor<T = Self> {
type Output = Self
fn bitxor(own self, _ other: own T) -> Self::Output
}
// Shift operators
pub trait Shl<T = Self> {
type Output = Self
fn shl(own self, _ other: own T) -> Self::Output
}
pub trait Shr<T = Self> {
type Output = Self
fn shr(own self, _ other: own T) -> Self::Output
}
pub trait Neg {
type Output = Self
fn neg(own self) -> Self::Output
}
pub trait Not {
type Output = Self
fn not(own self) -> Self::Output
}
pub trait BitNot {
type Output = Self
fn bit_not(own self) -> Self::Output
}
// Comparison operators
pub trait Eq<T = Self> {
fn eq(self, _ other: T) -> bool
fn ne(self, _ other: T) -> bool {
!self.eq(other)
}
}
pub trait Ord<T = Self> {
fn lt(self, _ other: T) -> bool
fn le(self, _ other: T) -> bool
fn gt(self, _ other: T) -> bool
fn ge(self, _ other: T) -> bool
}
// Indexing operator
pub trait Index<I> {
type Output
fn index(self, _ index: I) -> Self::Output
}
// Augmented assignment operators (return unit)
pub trait AddAssign<T = Self> {
fn add_assign(mut self, _ other: own T)
}
pub trait SubAssign<T = Self> {
fn sub_assign(mut self, _ other: own T)
}
pub trait MulAssign<T = Self> {
fn mul_assign(mut self, _ other: own T)
}
pub trait DivAssign<T = Self> {
fn div_assign(mut self, _ other: own T)
}
pub trait RemAssign<T = Self> {
fn rem_assign(mut self, _ other: own T)
}
pub trait PowAssign<T = Self> {
fn pow_assign(mut self, _ other: own T)
}
pub trait ShlAssign<T = Self> {
fn shl_assign(mut self, _ other: own T)
}
pub trait ShrAssign<T = Self> {
fn shr_assign(mut self, _ other: own T)
}
pub trait BitAndAssign<T = Self> {
fn bitand_assign(mut self, _ other: own T)
}
pub trait BitOrAssign<T = Self> {
fn bitor_assign(mut self, _ other: own T)
}
pub trait BitXorAssign<T = Self> {
fn bitxor_assign(mut self, _ other: own T)
}