vec_historic/
defines.rs

1use super::vec_historic::VecHistoric;
2
3// pub struct Drain<'a, T: 'a> {
4//     pub(super) inner: &'a mut VecHistoric<T>,
5//     pub(super) idx: usize,
6//     pub(super) len: usize,
7// }
8
9pub struct IntoIter<T> {
10    pub(super) inner: VecHistoric<T>,
11}
12
13pub type Iter<'a, T> = std::iter::Chain<std::slice::Iter<'a, T>, std::slice::Iter<'a, T>>;
14pub type IterMut<'a, T> = std::iter::Chain<std::slice::IterMut<'a, T>, std::slice::IterMut<'a, T>>;
15
16// pub type RemoveData<T> = (Vec<(usize, T)>); // index, element
17
18#[derive(Clone, Debug)]
19pub struct RemoveData<T> {
20    pub indecies: Vec<usize>,
21    pub values: Vec<T>
22}
23
24#[derive(Clone, Debug)]
25pub struct MoveData {
26    pub dest_index: usize,
27    pub indecies: Vec<usize>,
28}
29
30#[derive(Clone, Debug)]
31pub struct InsertData {
32    pub index: usize,
33    pub amount: usize, // amount of inserted elements
34}
35
36#[derive(Clone, Debug)]
37pub enum Action<T> {
38    Remove(RemoveData<T>),
39    Move(MoveData),
40    Insert(InsertData),
41    PushBack,
42    PopBack(T),
43    PushFront,
44    PopFront(T),
45}