pub struct OptRecord<Octs> { /* private fields */ }
Expand description
An entire OPT record.
Because the EDNS specificiation uses parts of the header of the OPT record
to convey some information, a special record type is necessary for OPT
records. You can convert a normal record with Opt
record data into
an OptRecord
via the from_record
function.
Implementations§
source§impl<Octs> OptRecord<Octs>
impl<Octs> OptRecord<Octs>
sourcepub fn from_record<N: ToDname>(record: Record<N, Opt<Octs>>) -> Self
pub fn from_record<N: ToDname>(record: Record<N, Opt<Octs>>) -> Self
Converts a regular record into an OPT record
sourcepub fn udp_payload_size(&self) -> u16
pub fn udp_payload_size(&self) -> u16
Returns the UDP payload size.
Through this field a sender of a message can signal the maximum size of UDP payload the sender is able to handle when receiving messages. This value refers to the abilities of the sender’s DNS implementation, not such things as network MTUs. Which means that the largest UDP payload that can actually be sent back to the sender may be smaller.
sourcepub fn rcode(&self, header: Header) -> OptRcode
pub fn rcode(&self, header: Header) -> OptRcode
Returns the extended rcode.
Some of the bits of the rcode are stored in the regular message header. Such a header needs to be passed to the method.
sourcepub fn version(&self) -> u8
pub fn version(&self) -> u8
Returns the EDNS version of the OPT header.
Only EDNS version 0 is currently defined.