c6794e260c04359502dca30f3e7552bca34a6172
[vector-math.git] / src / scalar.rs
1 use crate::traits::{Context, Make};
2
3 #[derive(Clone, Copy, PartialEq, Eq, Hash, Debug, Default)]
4 pub struct Scalar;
5
6 impl Context for Scalar {
7 type Bool = bool;
8
9 type U8 = u8;
10
11 type I8 = i8;
12
13 type U16 = u16;
14
15 type I16 = i16;
16
17 type F16 = crate::f16::F16;
18
19 type U32 = u32;
20
21 type I32 = i32;
22
23 type F32 = f32;
24
25 type U64 = u64;
26
27 type I64 = i64;
28
29 type F64 = f64;
30
31 type VecBool = bool;
32
33 type VecU8 = u8;
34
35 type VecI8 = i8;
36
37 type VecU16 = u16;
38
39 type VecI16 = i16;
40
41 type VecF16 = crate::f16::F16;
42
43 type VecU32 = u32;
44
45 type VecI32 = i32;
46
47 type VecF32 = f32;
48
49 type VecU64 = u64;
50
51 type VecI64 = i64;
52
53 type VecF64 = f64;
54 }
55
56 impl<T> Make<Scalar> for T {
57 type Prim = T;
58
59 fn make(_ctx: Scalar, v: Self::Prim) -> Self {
60 v
61 }
62 }