Struct abstract_ns::Address [] [src]

pub struct Address(_);

Address that nameservice has returned

We hide this structure to allow future additions. There is AddressBuilder 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]

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

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

Returns iterator over WeightedSet's starting from high priority set

Trait Implementations

impl Clone for Address
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for Address
[src]

Formats the value using the given formatter.

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

Performs the conversion.

impl From<SocketAddr> for Address
[src]

Performs the conversion.

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

Performs the conversion.

impl FromIterator<SocketAddr> for Address
[src]

Creates a value from an iterator. Read more

impl PartialEq for Address
[src]

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

This method tests for !=.

impl Eq for Address
[src]