Struct domain::resolv::lookup::host::FoundHosts [−][src]
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]
aaaa: Result<R::Answer, Error>,
a: Result<R::Answer, Error>
) -> Result<Self, Error>
pub fn is_empty(&self) -> bool
[src]
impl<R: Resolver> FoundHosts<R> where
&'a R::Octets: OctetsRef,
[src]
&'a R::Octets: OctetsRef,
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]
Notable traits for FoundHostsIter<Ref>
impl<Ref: OctetsRef> Iterator for FoundHostsIter<Ref> type Item = IpAddr;
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]
Notable traits for FoundHostsSocketIter<Ref>
impl<Ref: OctetsRef> Iterator for FoundHostsSocketIter<Ref> type Item = SocketAddr;
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
Auto Trait Implementations
impl<R> !RefUnwindSafe for FoundHosts<R>
impl<R> Send for FoundHosts<R> where
<R as Resolver>::Answer: Send,
<R as Resolver>::Answer: Send,
impl<R> Sync for FoundHosts<R> where
<R as Resolver>::Answer: Sync,
<R as Resolver>::Answer: Sync,
impl<R> Unpin for FoundHosts<R> where
<R as Resolver>::Answer: Unpin,
<R as Resolver>::Answer: Unpin,
impl<R> !UnwindSafe for FoundHosts<R>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<Source, Target> OctetsInto<Target> for Source where
Target: OctetsFrom<Source>,
[src]
Target: OctetsFrom<Source>,
pub fn octets_into(Self) -> Result<Target, ShortBuf>
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,