pub fn get_weighted_item<T>( items: &[T], index: i32, weight: impl Fn(&T) -> i32, ) -> Option<&T>
Returns the entry whose cumulative weight range contains index.
index