[][src]Trait tlid::IdAble

pub trait IdAble: Ord + Copy + Add<Output = Self> + Sub<Output = Self> + AddAssign + Default + Debug + From<u8> {
    fn inc(&mut self);
fn inc_by(&mut self, other: Self); }

trait that is used to describe all types that can be used as an ID types like usize, u64, i64, ... are supported by default

  • Ord: is needed for keeping a BTreeMap over free ranges
  • Copy: as IDs should be small enough to be copied everywhere
  • Add/Sub/AddAssign: for logic to increase and check generated IDs
  • Default: to count the number of ID's in a pool
  • Debug: to be used in Error Types and printed
  • From to convert 1 into the respective ID type

Required methods

fn inc(&mut self)

fn inc_by(&mut self, other: Self)

Loading content...

Implementors

impl<X: Ord + Clone + Copy + Add<Output = X> + Sub<Output = Self> + AddAssign + Default + Debug + From<u8>> IdAble for X[src]

Loading content...