httlib_hpack/encoder/
input.rs1#[derive(Debug)]
3pub enum EncoderInput {
4 Indexed(u32),
6
7 IndexedName(u32, Vec<u8>, u8),
10
11 Literal(Vec<u8>, Vec<u8>, u8),
14}
15
16impl<'a> From<u32> for EncoderInput {
17 fn from(field: u32) -> Self {
18 EncoderInput::Indexed(field)
19 }
20}
21
22impl<'a> From<(u32, Vec<u8>, u8)> for EncoderInput {
23 fn from(field: (u32, Vec<u8>, u8)) -> Self {
24 EncoderInput::IndexedName(field.0, field.1, field.2)
25 }
26}
27
28impl<'a> From<(Vec<u8>, Vec<u8>, u8)> for EncoderInput {
29 fn from(field: (Vec<u8>, Vec<u8>, u8)) -> Self {
30 EncoderInput::Literal(field.0, field.1, field.2)
31 }
32}