1use std::ops::*;
2
3trait Ops<Rhs=Self, Output=Self>:
4 Add<Rhs, Output = Output>
5 + Sub<Rhs, Output = Output>
6 + Mul<Rhs, Output = Output>
7 + Div<Rhs, Output = Output>
8 + Rem<Rhs, Output = Output> {}
9
10trait OpsAssign<Rhs=Self>:
11 AddAssign<Rhs>
12 + SubAssign<Rhs>
13 + MulAssign<Rhs>
14 + DivAssign<Rhs>
15 + RemAssign<Rhs> {}
16
17trait Zero {
18 fn zero() -> Self;
19 fn is_zero(&self) -> bool;
20 fn set_zero(&self);
21}
22
23trait One {
24 fn one() -> Self;
25 fn is_one(&self) -> bool;
26 fn set_one(&self);
27}
28
29trait Num: PartialEq + Ops + OpsAssign + One + Zero + Copy + Clone + Sized {}