httlib_protos/encoder/
lit.rs1#[derive(Debug)]
5pub enum EncoderLit<'a> {
6 Bytes(&'a Vec<u8>),
8
9 Bool(&'a bool),
11
12 BoolVec(&'a Vec<bool>),
14
15 Int32(&'a i32),
17
18 Int32Vec(&'a Vec<i32>),
20
21 Int64(&'a i64),
23
24 Int64Vec(&'a Vec<i64>),
26
27 UInt32(&'a u32),
29
30 UInt32Vec(&'a Vec<u32>),
32
33 UInt64(&'a u64),
35
36 UInt64Vec(&'a Vec<u64>),
38
39 Float(&'a f32),
41
42 FloatVec(&'a Vec<f32>),
44
45 Double(&'a f64),
47
48 DoubleVec(&'a Vec<f64>),
50
51 SInt32(&'a i32),
54
55 SInt32Vec(&'a Vec<i32>),
58
59 SInt64(&'a i64),
62
63 SInt64Vec(&'a Vec<i64>),
66
67 Fixed32(&'a u32),
69
70 Fixed32Vec(&'a Vec<u32>),
72
73 Fixed64(&'a u64),
75
76 Fixed64Vec(&'a Vec<u64>),
78
79 SFixed32(&'a i32),
81
82 SFixed32Vec(&'a Vec<i32>),
85
86 SFixed64(&'a i64),
88
89 SFixed64Vec(&'a Vec<i64>),
92}
93
94impl<'a> From<&'a bool> for EncoderLit<'a> {
95 fn from(v: &'a bool) -> Self {
96 Self::Bool(v)
97 }
98}
99
100impl<'a> From<&'a Vec<bool>> for EncoderLit<'a> {
101 fn from(v: &'a Vec<bool>) -> Self {
102 Self::BoolVec(v)
103 }
104}
105
106impl<'a> From<&'a i32> for EncoderLit<'a> {
107 fn from(v: &'a i32) -> Self {
108 Self::Int32(v)
109 }
110}
111
112impl<'a> From<&'a Vec<i32>> for EncoderLit<'a> {
113 fn from(v: &'a Vec<i32>) -> Self {
114 Self::Int32Vec(v)
115 }
116}
117
118impl<'a> From<&'a i64> for EncoderLit<'a> {
119 fn from(v: &'a i64) -> Self {
120 Self::Int64(v)
121 }
122}
123
124impl<'a> From<&'a Vec<i64>> for EncoderLit<'a> {
125 fn from(v: &'a Vec<i64>) -> Self {
126 Self::Int64Vec(v)
127 }
128}
129
130impl<'a> From<&'a u32> for EncoderLit<'a> {
131 fn from(v: &'a u32) -> Self {
132 Self::UInt32(v)
133 }
134}
135
136impl<'a> From<&'a Vec<u32>> for EncoderLit<'a> {
137 fn from(v: &'a Vec<u32>) -> Self {
138 Self::UInt32Vec(v)
139 }
140}
141
142impl<'a> From<&'a u64> for EncoderLit<'a> {
143 fn from(v: &'a u64) -> Self {
144 Self::UInt64(v)
145 }
146}
147
148impl<'a> From<&'a Vec<u64>> for EncoderLit<'a> {
149 fn from(v: &'a Vec<u64>) -> Self {
150 Self::UInt64Vec(v)
151 }
152}
153
154impl<'a> From<&'a f32> for EncoderLit<'a> {
155 fn from(v: &'a f32) -> Self {
156 Self::Float(v)
157 }
158}
159
160impl<'a> From<&'a Vec<f32>> for EncoderLit<'a> {
161 fn from(v: &'a Vec<f32>) -> Self {
162 Self::FloatVec(v)
163 }
164}
165
166impl<'a> From<&'a f64> for EncoderLit<'a> {
167 fn from(v: &'a f64) -> Self {
168 Self::Double(v)
169 }
170}
171
172impl<'a> From<&'a Vec<f64>> for EncoderLit<'a> {
173 fn from(v: &'a Vec<f64>) -> Self {
174 Self::DoubleVec(v)
175 }
176}
177
178impl<'a> From<&'a Vec<u8>> for EncoderLit<'a> {
179 fn from(v: &'a Vec<u8>) -> Self {
180 Self::Bytes(v)
181 }
182}