WItem

Type Alias WItem 

Source
pub type WItem<V, W> = WeightedItem<V, W>;
Expand description

A shorthand for WeightedItem.

If you refer to WeightedItem prolifically in your code, you may wish to use this for brevity. Otherwise, the full WeightedItem is recommended for clarity.

Aliased Type§

pub struct WItem<V, W> {
    pub weight: W,
    pub value: V,
}

Fields§

§weight: W

The weight of the item. A positive number. 0 is technically valid, but not advised.

§Notes

  • num_traits::Unsigned is not enforced because this is incompatible with non-integer W (f32, f64, etc.) which are always signed.
§value: V

The value stored in the item.