Easy to implement predicate traits.
```rust
enum NumType { Odd, Even, DivByThree, DivByFour, DivByFive, IsMagicNum(i32), } ```
expand:
```rust
enum NumType {
Odd,
Even,
DivByThree,
DivByFour,
DivByFive,
IsMagicNum(i32),
Unit(OpUnitInnerType
impl std::ops::BitAnd for NumType { type Output = Self;
fn bitand(self, rhs: Self) -> Self::Output {
let node = OpUnit::new(
Some(OpUnitInnerType::new(self)),
Some(OpUnitInnerType::new(rhs)),
Operation::And,
);
NumType::Unit(OpUnitInnerType::new(node))
}
}
impl std::ops::BitOr for NumType { type Output = Self;
fn bitor(self, rhs: Self) -> Self::Output {
let node = OpUnit::new(
Some(OpUnitInnerType::new(self)),
Some(OpUnitInnerType::new(rhs)),
Operation::Or,
);
NumType::Unit(OpUnitInnerType::new(node))
}
}
impl OpUnitTrait for NumType {
fn getopunit(self: &OpUnitInnerType