Struct rand::distributions::Weighted [] [src]

pub struct Weighted<T> {
    pub weight: u32,
    pub item: T,
}

A value with a particular weight for use with WeightedChoice.

Fields

weight

The numerical weight of this item

item

The actual item which is being weighted

Trait Implementations

Derived Implementations

impl<T: Copy> Copy for Weighted<T> where T: Copy

impl<T: Clone> Clone for Weighted<T> where T: Clone

fn clone(&self) -> Weighted<T>

fn clone_from(&mut self, source: &Self)