Struct abstract_ns::addr::Address [] [src]

pub struct Address(_);

Address that nameservice has returned

We hide this structure to allow future additions. There is Builder which provides a forward compatible way to build such address in a resolver and there are methods to extract data from it.

Internally it's an Arc over a structure so it's cheap to clone and you can cache addresses.

Methods

impl Address
[src]

[src]

Select one random address to connect to

Picks a single address from the set of high priority addresses, with the random distribution according to the weights.

This method is stateless so it can't find out that high priority addresses are all inaccessible and fallback addresses should be used.

Returns None if address is empty

[src]

Returns an owned iterator over addresses at priority

This is similar to self.at(pri).addresses() but returns an owned object that implements IntoIterator. This might be useful for streams and futures where borrowed objects don't work

[src]

Returns the set of the hosts for the same priority

Note: original priorities are lost. This method has contiguous array of sets of hosts. The highest priority hosts returned by .at(0).

If no hosts the priority exists returns an empty set

Use iter() to iterate over WeightedSet's by priority

[src]

Returns iterator over WeightedSet's starting from high priority set

[src]

Parse a list of strings and put it into an address

This only uses one layer of addresses with same weights. And is mostly useful for unit tests

Trait Implementations

impl Clone for Address
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl Debug for Address
[src]

[src]

Formats the value using the given formatter.

impl From<(IpAddr, u16)> for Address
[src]

[src]

Performs the conversion.

impl From<SocketAddr> for Address
[src]

[src]

Performs the conversion.

impl<'a> From<&'a [SocketAddr]> for Address
[src]

[src]

Performs the conversion.

impl FromIterator<SocketAddr> for Address
[src]

[src]

Creates a value from an iterator. Read more

impl AsRef<Address> for Address
[src]

[src]

Performs the conversion.

impl PartialEq for Address
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

1.0.0
[src]

This method tests for !=.

impl Eq for Address
[src]