scalar/
lib.rs

1#![feature(op_assign_traits)]
2
3use std::default::*;
4use std::marker::Send;
5use std::ops::*;
6
7mod abs;
8mod ident;
9
10pub use abs::*;
11pub use ident::*;
12
13pub trait Scalar:
14    Copy
15    + Send
16    + PartialEq
17    + PartialOrd
18    + Default
19    + Zero
20    + One
21    + Add<Self, Output = Self>
22    + AddAssign<Self>
23    + Sub<Self, Output = Self>
24    + SubAssign<Self>
25    + Mul<Self, Output = Self>
26    + MulAssign<Self>
27    + Div<Self, Output = Self>
28    + DivAssign<Self>
29    + Rem<Self, Output = Self>
30    + RemAssign<Self>
31    + Neg<Output = Self>
32    + Abs
33{
34}
35
36impl<S> Scalar for S
37where
38    S: Copy
39        + Send
40        + PartialEq
41        + PartialOrd
42        + Default
43        + Zero
44        + One
45        + Add<S, Output = S>
46        + AddAssign<S>
47        + Sub<S, Output = S>
48        + SubAssign<S>
49        + Mul<S, Output = S>
50        + MulAssign<S>
51        + Div<S, Output = S>
52        + DivAssign<S>
53        + Rem<S, Output = S>
54        + RemAssign<S>
55        + Neg<Output = S>
56        + Abs,
57{
58}