1 use rustc_index::vec::{Idx, IndexVec};
4 first: Option<Ls::LinkIndex>,
6 ) -> impl Iterator<Item = Ls::LinkIndex> + '_
10 VecLinkedListIterator { links, current: first }
13 pub struct VecLinkedListIterator<Ls>
18 current: Option<Ls::LinkIndex>,
21 impl<Ls> Iterator for VecLinkedListIterator<Ls>
25 type Item = Ls::LinkIndex;
27 fn next(&mut self) -> Option<Ls::LinkIndex> {
28 if let Some(c) = self.current {
29 self.current = <Ls as Links>::next(&self.links, c);
40 fn next(links: &Self, index: Self::LinkIndex) -> Option<Self::LinkIndex>;
43 impl<Ls> Links for &Ls
47 type LinkIndex = Ls::LinkIndex;
49 fn next(links: &Self, index: Ls::LinkIndex) -> Option<Ls::LinkIndex> {
50 <Ls as Links>::next(links, index)
57 fn next(elem: &Self) -> Option<Self::LinkIndex>;
60 impl<L, E> Links for IndexVec<L, E>
62 E: LinkElem<LinkIndex = L>,
67 fn next(links: &Self, index: L) -> Option<L> {
68 <E as LinkElem>::next(&links[index])