Struct abstract_ns::addr::WeightedSet [] [src]

pub struct WeightedSet<'a> { /* fields omitted */ }

A structure that represents a set of addresses of the same priority

Methods

impl<'a> WeightedSet<'a>
[src]

[src]

Select one random address to connect to

This function selects a host according to the random distribution according to the weights.

Returns None if the set is empty

[src]

Returns iterator over underlying addresses

This effectively discards weights, but may be useful for cases where you treat addresses as a set. For example to find out whether two Address values intersect over SocketAddr.

[src]

Compares two weighted sets to find out which addresses have been removed from set or added

This doesn't compare weights of the addresses

Trait Implementations

impl<'a> Debug for WeightedSet<'a>
[src]

[src]

Formats the value using the given formatter.

impl<'a> PartialEq for WeightedSet<'a>
[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 !=.