[][src]Struct domain::base::message::RecordIter

pub struct RecordIter<Ref, Data> { /* fields omitted */ }

An iterator over specific records of a record section of a DNS message.

The iterator’s item type is the result of trying to parse a record. It silently skips over all records that Data cannot or does not want to parse. If parsing the record data fails, the iterator will return an error but can continue with the next record. If parsing the entire record fails the item will be an error and subsequent attempts to continue will also produce errors. This case can be distinguished from an error while parsing the record data by next_section returning an error, too.

You can create a value of this type through the RecordSection::limit_to method.

Implementations

impl<Ref: OctetsRef, Data: ParseRecordData<Ref>> RecordIter<Ref, Data>[src]

pub fn unwrap(self) -> RecordSection<Ref>[src]

Trades the limited iterator for the full iterator.

The returned iterator will continue right after the last record previously returned.

pub fn next_section(self) -> Result<Option<RecordSection<Ref>>, ParseError>[src]

Proceeds to the next section if there is one.

Returns an error if parsing the message has failed. Returns Ok(None) if this iterator was already on the additional section.

Trait Implementations

impl<Ref: Clone, Data: Clone> Clone for RecordIter<Ref, Data>[src]

impl<Ref: Copy, Data: Copy> Copy for RecordIter<Ref, Data>[src]

impl<Ref: Debug, Data: Debug> Debug for RecordIter<Ref, Data>[src]

impl<Ref, Data> Iterator for RecordIter<Ref, Data> where
    Ref: OctetsRef,
    Data: ParseRecordData<Ref>, 
[src]

type Item = Result<Record<ParsedDname<Ref>, Data>, ParseError>

The type of the elements being iterated over.

Auto Trait Implementations

impl<Ref, Data> RefUnwindSafe for RecordIter<Ref, Data> where
    Data: RefUnwindSafe,
    Ref: RefUnwindSafe

impl<Ref, Data> Send for RecordIter<Ref, Data> where
    Data: Send,
    Ref: Send

impl<Ref, Data> Sync for RecordIter<Ref, Data> where
    Data: Sync,
    Ref: Sync

impl<Ref, Data> Unpin for RecordIter<Ref, Data> where
    Data: Unpin,
    Ref: Unpin

impl<Ref, Data> UnwindSafe for RecordIter<Ref, Data> where
    Data: UnwindSafe,
    Ref: 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<I> IntoIterator for I where
    I: Iterator
[src]

type Item = <I as Iterator>::Item

The type of the elements being iterated over.

type IntoIter = I

Which kind of iterator are we turning this into?

impl<I> IteratorRandom for I where
    I: Iterator
[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>,