rustyms/peptidoform/
complexity.rs1use serde::{Deserialize, Serialize};
4
5#[derive(
7 Debug, Default, Copy, Clone, PartialEq, PartialOrd, Ord, Eq, Hash, Serialize, Deserialize,
8)]
9pub struct Linked;
10
11#[derive(
13 Debug, Default, Copy, Clone, PartialEq, PartialOrd, Ord, Eq, Hash, Serialize, Deserialize,
14)]
15pub struct Linear;
16
17#[derive(
23 Debug, Default, Copy, Clone, PartialEq, PartialOrd, Ord, Eq, Hash, Serialize, Deserialize,
24)]
25pub struct SimpleLinear;
26
27#[derive(
33 Debug, Default, Copy, Clone, PartialEq, PartialOrd, Ord, Eq, Hash, Serialize, Deserialize,
34)]
35pub struct SemiAmbiguous;
36
37#[derive(
42 Debug, Default, Copy, Clone, PartialEq, PartialOrd, Ord, Eq, Hash, Serialize, Deserialize,
43)]
44pub struct UnAmbiguous;
45
46pub trait AtMax<T> {}
49impl<T> AtMax<T> for T {}
50impl AtMax<Linked> for Linear {}
51impl AtMax<Linked> for SimpleLinear {}
52impl AtMax<Linked> for SemiAmbiguous {}
53impl AtMax<Linked> for UnAmbiguous {}
54impl AtMax<Linear> for SimpleLinear {}
55impl AtMax<Linear> for SemiAmbiguous {}
56impl AtMax<Linear> for UnAmbiguous {}
57impl AtMax<SimpleLinear> for SemiAmbiguous {}
58impl AtMax<SimpleLinear> for UnAmbiguous {}
59impl AtMax<SemiAmbiguous> for UnAmbiguous {}
60
61pub trait AtLeast<T> {}
64impl<T> AtLeast<T> for T {}
65impl AtLeast<Linear> for Linked {}
66impl AtLeast<SimpleLinear> for Linked {}
67impl AtLeast<SemiAmbiguous> for Linked {}
68impl AtLeast<UnAmbiguous> for Linked {}
69impl AtLeast<SimpleLinear> for Linear {}
70impl AtLeast<SemiAmbiguous> for Linear {}
71impl AtLeast<UnAmbiguous> for Linear {}
72impl AtLeast<SemiAmbiguous> for SimpleLinear {}
73impl AtLeast<UnAmbiguous> for SimpleLinear {}
74impl AtLeast<UnAmbiguous> for SemiAmbiguous {}
75
76pub trait HighestOf<T> {
79 type HighestLevel;
81}
82impl<T> HighestOf<T> for T {
83 type HighestLevel = T;
84}
85impl HighestOf<Linked> for Linear {
86 type HighestLevel = Linked;
87}
88impl HighestOf<Linked> for SimpleLinear {
89 type HighestLevel = Linked;
90}
91impl HighestOf<Linked> for SemiAmbiguous {
92 type HighestLevel = Linked;
93}
94impl HighestOf<Linked> for UnAmbiguous {
95 type HighestLevel = Linked;
96}
97impl HighestOf<Linear> for SimpleLinear {
98 type HighestLevel = Linear;
99}
100impl HighestOf<Linear> for SemiAmbiguous {
101 type HighestLevel = Linear;
102}
103impl HighestOf<Linear> for UnAmbiguous {
104 type HighestLevel = Linear;
105}
106impl HighestOf<SimpleLinear> for SemiAmbiguous {
107 type HighestLevel = SimpleLinear;
108}
109impl HighestOf<SimpleLinear> for UnAmbiguous {
110 type HighestLevel = SimpleLinear;
111}
112impl HighestOf<SemiAmbiguous> for UnAmbiguous {
113 type HighestLevel = SemiAmbiguous;
114}
115impl HighestOf<Linear> for Linked {
116 type HighestLevel = Self;
117}
118impl HighestOf<SimpleLinear> for Linked {
119 type HighestLevel = Self;
120}
121impl HighestOf<SemiAmbiguous> for Linked {
122 type HighestLevel = Self;
123}
124impl HighestOf<UnAmbiguous> for Linked {
125 type HighestLevel = Self;
126}
127impl HighestOf<SimpleLinear> for Linear {
128 type HighestLevel = Self;
129}
130impl HighestOf<SemiAmbiguous> for Linear {
131 type HighestLevel = Self;
132}
133impl HighestOf<UnAmbiguous> for Linear {
134 type HighestLevel = Self;
135}
136impl HighestOf<SemiAmbiguous> for SimpleLinear {
137 type HighestLevel = Self;
138}
139impl HighestOf<UnAmbiguous> for SimpleLinear {
140 type HighestLevel = Self;
141}
142impl HighestOf<UnAmbiguous> for SemiAmbiguous {
143 type HighestLevel = Self;
144}