Struct domain::base::opt::OptHeader[][src]

pub struct OptHeader { /* fields omitted */ }

The header of an OPT record.

The OPT record reappropriates the record header for encoding some basic information. This type provides access to this information. It consists of the record header accept for its rdlen field.

This is so that OptBuilder can safely deref to this type.

Implementations

impl OptHeader[src]

pub fn for_record_slice(slice: &[u8]) -> &OptHeader[src]

Returns a reference to an OPT header pointing into a record’s octets.

pub fn for_record_slice_mut(slice: &mut [u8]) -> &mut OptHeader[src]

Returns a mutable reference pointing into a record’s octets.

pub fn udp_payload_size(&self) -> u16[src]

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.

pub fn set_udp_payload_size(&mut self, value: u16)[src]

Sets the UDP payload size value.

pub fn rcode(&self, header: Header) -> OptRcode[src]

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.

pub fn set_rcode(&mut self, rcode: OptRcode)[src]

Sets the extend rcode of the OPT header.

This method only sets the upper bits of the rcode. The lower bits need to be set in the message header.

pub fn version(&self) -> u8[src]

Returns the EDNS version of the OPT header.

Only EDNS version 0 is currently defined.

pub fn set_version(&mut self, version: u8)[src]

Sets the EDNS version of the OPT header.

pub fn dnssec_ok(&self) -> bool[src]

Returns the value of the DNSSEC OK (DO) bit.

By setting this bit, a resolver indicates that it is interested in also receiving the DNSSEC-related resource records necessary to validate an answer. The bit and the related procedures are defined in RFC 3225.

pub fn set_dnssec_ok(&mut self, value: bool)[src]

Sets the DNSSEC OK (DO) bit to the given value.

Trait Implementations

impl Clone for OptHeader[src]

impl Compose for OptHeader[src]

impl Copy for OptHeader[src]

impl Debug for OptHeader[src]

impl Default for OptHeader[src]

impl Eq for OptHeader[src]

impl PartialEq<OptHeader> for OptHeader[src]

impl StructuralEq for OptHeader[src]

impl StructuralPartialEq for OptHeader[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<Source, Target> OctetsInto<Target> for Source where
    Target: OctetsFrom<Source>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,