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

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

OPT record data.

This is the record data type for OPT records and can be used as the data type parameter in Record. It simply wraps an octets sequence with all the record data. It guarantees that the data contains a correctly formatted sequence of options but doesn’t guarantee that the options themselves are correct. You can iterate over options via the iter method.

Since some of the information of the OPT record is transmitted in the record header, a special type OptRecord exists, that contains all the OPT data which is the preferred way of accessing this data.

Implementations

impl<Octets: AsRef<[u8]>> Opt<Octets>[src]

pub fn from_octets(octets: Octets) -> Result<Self, ParseError>[src]

Creates OPT record data from an octets sequence.

The function checks whether the octets contain a sequence of options. It does not check whether the options themselves are valid.

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 Opt<Octets>[src]

impl<Octets: AsRef<[u8]>> Compose for Opt<Octets>[src]

impl<Octets: AsRef<[u8]>> Debug for Opt<Octets>[src]

impl<Octets: AsRef<[u8]>> Display for Opt<Octets>[src]

impl<Octets: AsRef<[u8]>> Eq for Opt<Octets>[src]

impl<O, N> From<Opt<O>> for AllRecordData<O, N>[src]

impl<Octets: AsRef<[u8]>> Hash for Opt<Octets>[src]

impl<Octets: AsRef<[u8]>> Ord for Opt<Octets>[src]

impl<Ref: OctetsRef> Parse<Ref> for Opt<Ref::Range>[src]

impl<Octets, Other> PartialEq<Opt<Other>> for Opt<Octets> where
    Octets: AsRef<[u8]>,
    Other: AsRef<[u8]>, 
[src]

impl<Octets, Other> PartialOrd<Opt<Other>> for Opt<Octets> where
    Octets: AsRef<[u8]>,
    Other: AsRef<[u8]>, 
[src]

impl<Octets> RtypeRecordData for Opt<Octets>[src]

Auto Trait Implementations

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

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

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

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

impl<Octets> UnwindSafe for Opt<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<Octets, T> ParseRecordData<Octets> for T where
    T: RtypeRecordData + Parse<Octets> + Compose
[src]

impl<T> RecordData for T where
    T: Compose + RtypeRecordData
[src]

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

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

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