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.
Trait Implementations§
source§impl<Octs, SrcOcts> OctetsFrom<OptRecord<SrcOcts>> for OptRecord<Octs>where
Octs: OctetsFrom<SrcOcts>,
impl<Octs, SrcOcts> OctetsFrom<OptRecord<SrcOcts>> for OptRecord<Octs>where
Octs: OctetsFrom<SrcOcts>,
type Error = <Octs as OctetsFrom<SrcOcts>>::Error
Auto Trait Implementations§
impl<Octs> Freeze for OptRecord<Octs>where
Octs: Freeze,
impl<Octs> RefUnwindSafe for OptRecord<Octs>where
Octs: RefUnwindSafe,
impl<Octs> Send for OptRecord<Octs>where
Octs: Send,
impl<Octs> Sync for OptRecord<Octs>where
Octs: Sync,
impl<Octs> Unpin for OptRecord<Octs>where
Octs: Unpin,
impl<Octs> UnwindSafe for OptRecord<Octs>where
Octs: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)