Function solana_gossip::weighted_shuffle::weighted_shuffle [−][src]
pub fn weighted_shuffle<T, B, F>(weights: F, seed: [u8; 32]) -> Vec<usize>ⓘ where
T: Copy + PartialOrd + Sum + Div<T, Output = T> + FromPrimitive + ToPrimitive,
B: Borrow<T>,
F: Iterator<Item = B> + Clone,
Expand description
Returns a list of indexes shuffled based on the input weights
Note - The sum of all weights must not exceed u64::MAX