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