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
use std::fmt::{Debug, Display};

// TODO: documentation
pub trait NumLike: std::ops::Add<Output=Self>
+ std::ops::AddAssign
+ std::ops::Sub<Output=Self>
+ std::ops::SubAssign
+ std::ops::Mul<Output=Self>
+ std::ops::MulAssign
+ std::ops::Div<Output=Self>
+ std::ops::DivAssign
+ std::ops::Neg<Output=Self>
+ Clone
+ Debug
+ Display
{}
impl<T> NumLike for T where T: std::ops::Add<Output=Self>
+ std::ops::AddAssign
+ std::ops::Sub<Output=Self>
+ std::ops::SubAssign
+ std::ops::Mul<Output=Self>
+ std::ops::MulAssign
+ std::ops::Div<Output=Self>
+ std::ops::DivAssign
+ std::ops::Neg<Output=Self>
+ Clone
+ Debug
+ Display
{}