Struct ns_env_config::IpList
[−]
[src]
pub struct IpList(_);
IpList is a wrapper type around Vec<IpAddr>
which serves the same
role as the Address
but for resolving hostnames (or A
records) instead
of services (i.e. host:port pairs or SRV
records)
Similarlty to Address
this type can be cloned cheaply
Methods
impl IpList
[src]
fn pick_one(&self) -> Option<IpAddr>
[src]
Select one random address to connect to
This function selects a random address from the list of addresses or
None
if list is empty.
fn iter(&self) -> IpIterator
[src]
Iterate over IP addresses in the list
fn with_port(&self, port: u16) -> Address
[src]
Create an Address
object by attaching the specified to all addresses
fn parse_list<I>(iter: I) -> Result<IpList, AddrParseError> where
I: IntoIterator,
<I as IntoIterator>::Item: AsRef<str>,
[src]
I: IntoIterator,
<I as IntoIterator>::Item: AsRef<str>,
Parse a list of strings and put it into an ip_list
This is mostly useful for unit tests
Trait Implementations
impl Clone for IpList
[src]
impl Eq for IpList
[src]
impl From<Vec<IpAddr>> for IpList
[src]
impl<'a> IntoIterator for &'a IpList
[src]
impl PartialEq<IpList> for IpList
[src]
fn eq(&self, __arg_0: &IpList) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &IpList) -> bool
[src]
This method tests for !=
.
impl Debug for IpList
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result<(), Error>
[src]
Formats the value using the given formatter.
impl FromIterator<IpAddr> for IpList
[src]
fn from_iter<T>(iter: T) -> IpList where
T: IntoIterator<Item = IpAddr>,
[src]
T: IntoIterator<Item = IpAddr>,