Struct domain::resolv::lookup::host::FoundHosts[][src]

pub struct FoundHosts<R: Resolver> { /* fields omitted */ }

The value returned by a successful host lookup.

You can use the iter() method to get an iterator over the IP addresses or port_iter() to get an iterator over socket addresses with the given port.

The canonical_name() method returns the canonical name of the host for which the addresses were found.

Implementations

impl<R: Resolver> FoundHosts<R>[src]

pub fn new(
    aaaa: Result<R::Answer, Error>,
    a: Result<R::Answer, Error>
) -> Result<Self, Error>
[src]

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

impl<R: Resolver> FoundHosts<R> where
    &'a R::Octets: OctetsRef
[src]

pub fn qname(&self) -> ParsedDname<&R::Octets>[src]

pub fn canonical_name(&self) -> ParsedDname<&R::Octets>[src]

Returns a reference to the canonical name for the host.

Notes

This method expects the canonical name to be same in both A/AAAA responses, if it isn’t, it’s going to return a canonical name for one of them.

pub fn iter(&self) -> FoundHostsIter<&R::Octets>

Notable traits for FoundHostsIter<Ref>

impl<Ref: OctetsRef> Iterator for FoundHostsIter<Ref> type Item = IpAddr;
[src]

Returns an iterator over the IP addresses returned by the lookup.

pub fn port_iter(&self, port: u16) -> FoundHostsSocketIter<&R::Octets>

Notable traits for FoundHostsSocketIter<Ref>

impl<Ref: OctetsRef> Iterator for FoundHostsSocketIter<Ref> type Item = SocketAddr;
[src]

Returns an iterator over socket addresses gained from the lookup.

The socket addresses are gained by combining the IP addresses with port. The returned iterator implements ToSocketAddrs and thus can be used where std::net wants addresses right away.

Trait Implementations

impl<R: Debug + Resolver> Debug for FoundHosts<R> where
    R::Answer: Debug,
    R::Answer: Debug
[src]

Auto Trait Implementations

impl<R> !RefUnwindSafe for FoundHosts<R>

impl<R> Send for FoundHosts<R> where
    <R as Resolver>::Answer: Send

impl<R> Sync for FoundHosts<R> where
    <R as Resolver>::Answer: Sync

impl<R> Unpin for FoundHosts<R> where
    <R as Resolver>::Answer: Unpin

impl<R> !UnwindSafe for FoundHosts<R>

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