use std::{fmt, io::Cursor};
use crate::error::HaProxRes;
pub mod protocol;
pub mod protocol_raw;
pub mod protocol_parser;
pub mod protocol_composer;
pub mod autogen;
pub trait PP2TlvUniqId: fmt::Display
{
fn into_bytes(&self) -> Vec<u8>;
fn get_len(&self) -> u16;
}
pub trait ProxyV2OpCode: fmt::Debug + Clone
{
const OPCODE: u8;
}
pub trait PP2TlvDump: fmt::Debug + fmt::Display
{
fn get_type(&self) -> u8;
fn dump(&self, cur: &mut Cursor<Vec<u8>>) -> HaProxRes<()>;
}
pub trait PP2TlvRestore: fmt::Debug + fmt::Display
{
fn is_in_range(tlv_type: u8, tlv_parent_type: Option<u8>) -> bool;
fn restore(tlv_type: u8, cur: &mut Cursor<&[u8]>) -> HaProxRes<Self> where Self: Sized;
fn contains_subtype(&self) -> bool;
}