Function solana_gossip::weighted_shuffle::weighted_shuffle[][src]

pub fn weighted_shuffle<T>(weights: &[T], seed: [u8; 32]) -> Vec<usize>
Notable traits for Vec<u8, A>
impl<A> Write for Vec<u8, A> where
    A: Allocator
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