pub trait RecordReader: Sized {
const REC_TYPE: QType;
const RLEN: u16;
// Required methods
fn read(
pkt: &mut Cursor<&[u8]>,
rlen: u16,
qtype: QType,
) -> CDnsResult<Self>;
fn wrap(self) -> DnsRdata;
}
Expand description
Trait for decoding DNS record structures from bytes read over the wire.
Required Associated Constants§
Required Methods§
Sourcefn read(pkt: &mut Cursor<&[u8]>, rlen: u16, qtype: QType) -> CDnsResult<Self>
fn read(pkt: &mut Cursor<&[u8]>, rlen: u16, qtype: QType) -> CDnsResult<Self>
Read at most len
bytes from the given Cursor
. This cursor travels
throughout the complete data — by this point, we have read the entire
response into a buffer.
fn wrap(self) -> DnsRdata
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.