use winnow::ModalResult; use crate::encoder::Encoder; pub trait DnsParse<'a>: Sized { fn parse(input: &mut &'a [u8], context: &'a [u8]) -> ModalResult; } pub trait DnsParseKind<'a> { type Output; fn parse_kind(&self, input: &mut &'a [u8], context: &'a [u8]) -> ModalResult; } pub trait DnsSerialize<'a> { type Error; fn serialize<'b>(&self, encoder: &mut Encoder<'a, 'b>) -> Result<(), Self::Error>; #[allow(dead_code)] fn size(&self) -> usize; }