1#![doc = include_str!("../README.md")]
2
3mod lending_iter;
4mod lending_iter_mut;
5mod popping_iter;
6mod trivial_last_entry;
7
8pub use lending_iter::LendingIter;
9pub use lending_iter_mut::LendingIterMut;
10pub use popping_iter::PoppingIter;
11pub use trivial_last_entry::TrivialLastEntry;
12
13pub trait VecVecExt {
17 type Item;
19
20 fn popping_iter(&mut self) -> PoppingIter<'_, Self::Item>;
22
23 fn lending_iter_mut(&mut self) -> LendingIterMut<'_, Self::Item>;
27
28 fn lending_iter(&self) -> LendingIter<'_, Self::Item>;
30
31 fn trivial_last_entry(&mut self) -> Option<TrivialLastEntry<'_, Self::Item>>;
32}
33
34impl<T> VecVecExt for Vec<Vec<T>> {
35 type Item = T;
36
37 fn popping_iter(&mut self) -> PoppingIter<'_, Self::Item> {
38 PoppingIter(self)
39 }
40
41 fn lending_iter_mut(&mut self) -> LendingIterMut<'_, Self::Item> {
42 LendingIterMut::new(self)
43 }
44
45 fn lending_iter(&self) -> LendingIter<'_, Self::Item> {
46 LendingIter::new(self)
47 }
48
49 fn trivial_last_entry(&mut self) -> Option<TrivialLastEntry<'_, Self::Item>> {
50 TrivialLastEntry::new(self)
51 }
52}