#[derive(Debug)]
pub enum EncoderLit<'a> {
Bytes(&'a Vec<u8>),
Bool(&'a bool),
BoolVec(&'a Vec<bool>),
Int32(&'a i32),
Int32Vec(&'a Vec<i32>),
Int64(&'a i64),
Int64Vec(&'a Vec<i64>),
UInt32(&'a u32),
UInt32Vec(&'a Vec<u32>),
UInt64(&'a u64),
UInt64Vec(&'a Vec<u64>),
Float(&'a f32),
FloatVec(&'a Vec<f32>),
Double(&'a f64),
DoubleVec(&'a Vec<f64>),
SInt32(&'a i32),
SInt32Vec(&'a Vec<i32>),
SInt64(&'a i64),
SInt64Vec(&'a Vec<i64>),
Fixed32(&'a u32),
Fixed32Vec(&'a Vec<u32>),
Fixed64(&'a u64),
Fixed64Vec(&'a Vec<u64>),
SFixed32(&'a i32),
SFixed32Vec(&'a Vec<i32>),
SFixed64(&'a i64),
SFixed64Vec(&'a Vec<i64>),
}
impl<'a> From<&'a bool> for EncoderLit<'a> {
fn from(v: &'a bool) -> Self {
Self::Bool(v)
}
}
impl<'a> From<&'a Vec<bool>> for EncoderLit<'a> {
fn from(v: &'a Vec<bool>) -> Self {
Self::BoolVec(v)
}
}
impl<'a> From<&'a i32> for EncoderLit<'a> {
fn from(v: &'a i32) -> Self {
Self::Int32(v)
}
}
impl<'a> From<&'a Vec<i32>> for EncoderLit<'a> {
fn from(v: &'a Vec<i32>) -> Self {
Self::Int32Vec(v)
}
}
impl<'a> From<&'a i64> for EncoderLit<'a> {
fn from(v: &'a i64) -> Self {
Self::Int64(v)
}
}
impl<'a> From<&'a Vec<i64>> for EncoderLit<'a> {
fn from(v: &'a Vec<i64>) -> Self {
Self::Int64Vec(v)
}
}
impl<'a> From<&'a u32> for EncoderLit<'a> {
fn from(v: &'a u32) -> Self {
Self::UInt32(v)
}
}
impl<'a> From<&'a Vec<u32>> for EncoderLit<'a> {
fn from(v: &'a Vec<u32>) -> Self {
Self::UInt32Vec(v)
}
}
impl<'a> From<&'a u64> for EncoderLit<'a> {
fn from(v: &'a u64) -> Self {
Self::UInt64(v)
}
}
impl<'a> From<&'a Vec<u64>> for EncoderLit<'a> {
fn from(v: &'a Vec<u64>) -> Self {
Self::UInt64Vec(v)
}
}
impl<'a> From<&'a f32> for EncoderLit<'a> {
fn from(v: &'a f32) -> Self {
Self::Float(v)
}
}
impl<'a> From<&'a Vec<f32>> for EncoderLit<'a> {
fn from(v: &'a Vec<f32>) -> Self {
Self::FloatVec(v)
}
}
impl<'a> From<&'a f64> for EncoderLit<'a> {
fn from(v: &'a f64) -> Self {
Self::Double(v)
}
}
impl<'a> From<&'a Vec<f64>> for EncoderLit<'a> {
fn from(v: &'a Vec<f64>) -> Self {
Self::DoubleVec(v)
}
}
impl<'a> From<&'a Vec<u8>> for EncoderLit<'a> {
fn from(v: &'a Vec<u8>) -> Self {
Self::Bytes(v)
}
}