generational_vector/lib.rs
1mod default_generation_type;
2pub mod iterators;
3pub mod vector;
4
5pub use default_generation_type::DefaultGenerationType;
6use num_traits::One;
7use std::ops::Add;
8pub use vector::DeletionResult;
9
10/// Type alias to simplify construction of generational vectors.
11pub type GenerationalVector<T> = vector::GenerationalVector<T, DefaultGenerationType>;
12
13/// Alias for required traits on the type used for the generation value.
14pub trait GenerationType: One + Copy + Add<Output = Self> + PartialEq {}
15
16/// Automatic implementation of `GenerationType` for all matching types.
17impl<T> GenerationType for T where T: One + Copy + Add<Output = T> + PartialEq {}