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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
use std::fmt::Debug;
pub trait Format: Copy + Debug + Default {
type NonDense: NonDense;
type UnitStrided: UnitStrided;
}
pub trait NonDense: Format {}
pub trait UnitStrided: Format {}
#[derive(Clone, Copy, Debug, Default)]
pub struct Dense;
#[derive(Clone, Copy, Debug, Default)]
pub struct General;
#[derive(Clone, Copy, Debug, Default)]
pub struct Strided;
impl Format for Dense {
type NonDense = General;
type UnitStrided = Dense;
}
impl Format for General {
type NonDense = General;
type UnitStrided = General;
}
impl Format for Strided {
type NonDense = Strided;
type UnitStrided = General;
}
impl NonDense for General {}
impl NonDense for Strided {}
impl UnitStrided for Dense {}
impl UnitStrided for General {}