Trait Weight

trait Weight: Clone

Bounds on a weight

See usage in WeightedIndex.

Required Methods

fn checked_add_assign(self: &mut Self, v: &Self) -> Result<(), ()>

Checked addition

  • Result::Ok: On success, v is added to self
  • Result::Err: Returns an error when Self cannot represent the result of self + v (i.e. overflow). The value of self should be discarded.

Implementors