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

pub struct OptRecord<Octets> { /* fields omitted */ }

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.

The type derefs to the Opt type and provides all its functionality that way.

Implementations

impl<Octets> OptRecord<Octets>[src]

pub fn from_record<N: ToDname>(record: Record<N, Opt<Octets>>) -> Self[src]

Converts a regular record into an OPT record

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 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 version(&self) -> u8[src]

Returns the EDNS version of the OPT header.

Only EDNS version 0 is currently defined.

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 as_opt(&self) -> &Opt<Octets>[src]

Returns a reference to the raw options.

Methods from Deref<Target = Opt<Octets>>

pub fn iter<Data>(&self) -> OptIter<&Octets, Data> where
    &'a Octets: OctetsRef,
    Data: for<'a> ParseOptData<&'a Octets>, 
[src]

Returns an iterator over options of a given type.

The returned iterator will return only options represented by type D and quietly skip over all the others.

Trait Implementations

impl<Octets> AsRef<Opt<Octets>> for OptRecord<Octets>[src]

impl<Octets: Clone> Clone for OptRecord<Octets>[src]

impl<Octets> Deref for OptRecord<Octets>[src]

type Target = Opt<Octets>

The resulting type after dereferencing.

impl<Octets, N: ToDname> From<Record<N, Opt<Octets>>> for OptRecord<Octets>[src]

Auto Trait Implementations

impl<Octets> RefUnwindSafe for OptRecord<Octets> where
    Octets: RefUnwindSafe

impl<Octets> Send for OptRecord<Octets> where
    Octets: Send

impl<Octets> Sync for OptRecord<Octets> where
    Octets: Sync

impl<Octets> Unpin for OptRecord<Octets> where
    Octets: Unpin

impl<Octets> UnwindSafe for OptRecord<Octets> where
    Octets: UnwindSafe

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<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>,