Trait gen_value::Incrementable
source · [−]pub trait Incrementable: PartialOrd + Sized {
fn next(&self) -> Option<Self>;
}Expand description
A type which can attempt to return the smallest value which is still bigger than the current value.
It is used for index and generation type parameters to find the next index or the next generation respectively.
Examples
An implementation of Incrementable has been made for all integer types.
use gen_value::Incrementable;
let value: u32 = 1;
assert_eq!(value.next(), Some(2));
assert_eq!(u32::MAX.next(), None);