[−][src]Function aquatic_common::extract_response_peers
pub fn extract_response_peers<K, V, R, F>(
rng: &mut impl Rng,
peer_map: &IndexMap<K, V>,
max_num_peers_to_take: usize,
sender_peer_map_key: K,
peer_conversion_function: F
) -> Vec<R> where
K: Eq + Hash,
F: Fn(&V) -> R,
Extract response peers
If there are more peers in map than max_num_peers_to_take
, do a
half-random selection of peers from first and second halves of map,
in order to avoid returning too homogeneous peers.
Might return one less peer than wanted since sender is filtered out.