Struct abstract_ns::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]

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

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.

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> PartialEq for WeightedSet<'a>
[src]

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

This method tests for !=.