use bytes::Bytes; use common_types::Type; use errors::*; use std::io::Cursor; use ser::DnsPacketData; pub trait RRDataPacket: Sized { fn deserialize_rr_data(ttl: u32, rr_class: u16, rr_type: Type, data: &mut Cursor) -> Result; } impl RRDataPacket for T { fn deserialize_rr_data(_ttl: u32, _rr_class: u16, _rr_type: Type, data: &mut Cursor) -> Result { T::deserialize(data) } } pub trait RRData: RRDataPacket + super::DnsTextData { fn rr_type(&self) -> Type; } pub trait StaticRRData: RRData { const TYPE: Type; const NAME: &'static str; }