Struct abstract_ns::ip_list::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::Item: AsRef<str>,
[src]
I: IntoIterator,
I::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 Debug for IpList
[src]
impl Clone for IpList
[src]
fn clone(&self) -> IpList
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl PartialEq 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 Eq for IpList
[src]
impl<'a> IntoIterator for &'a IpList
[src]
type Item = &'a IpAddr
The type of the elements being iterated over.
type IntoIter = IpIterator<'a>
Which kind of iterator are we turning this into?
fn into_iter(self) -> IpIterator<'a>
[src]
Creates an iterator from a value. Read more