Repo of no-std crates for my personal embedded projects
at main 501 B view raw
1use winnow::ModalResult; 2 3use crate::encoder::Encoder; 4 5pub trait DnsParse<'a>: Sized { 6 fn parse(input: &mut &'a [u8], context: &'a [u8]) -> ModalResult<Self>; 7} 8 9pub trait DnsParseKind<'a> { 10 type Output; 11 12 fn parse_kind(&self, input: &mut &'a [u8], context: &'a [u8]) -> ModalResult<Self::Output>; 13} 14 15pub trait DnsSerialize<'a> { 16 type Error; 17 18 fn serialize<'b>(&self, encoder: &mut Encoder<'a, 'b>) -> Result<(), Self::Error>; 19 #[allow(dead_code)] 20 fn size(&self) -> usize; 21}