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
#[derive(Debug)]
pub enum EncoderInput {
Indexed(u32),
IndexedName(u32, Vec<u8>, u8),
Literal(Vec<u8>, Vec<u8>, u8),
}
impl<'a> From<u32> for EncoderInput {
fn from(field: u32) -> Self {
EncoderInput::Indexed(field)
}
}
impl<'a> From<(u32, Vec<u8>, u8)> for EncoderInput {
fn from(field: (u32, Vec<u8>, u8)) -> Self {
EncoderInput::IndexedName(field.0, field.1, field.2)
}
}
impl<'a> From<(Vec<u8>, Vec<u8>, u8)> for EncoderInput {
fn from(field: (Vec<u8>, Vec<u8>, u8)) -> Self {
EncoderInput::Literal(field.0, field.1, field.2)
}
}