1 use crate::indexed_vec::{Idx, IndexVec};
4 first: Option<Ls::LinkIndex>,
6 ) -> impl Iterator<Item = Ls::LinkIndex> + 'a
10 VecLinkedListIterator {
16 pub struct VecLinkedListIterator<Ls>
21 current: Option<Ls::LinkIndex>,
24 impl<Ls> Iterator for VecLinkedListIterator<Ls>
28 type Item = Ls::LinkIndex;
30 fn next(&mut self) -> Option<Ls::LinkIndex> {
31 if let Some(c) = self.current {
32 self.current = <Ls as Links>::next(&self.links, c);
43 fn next(links: &Self, index: Self::LinkIndex) -> Option<Self::LinkIndex>;
46 impl<Ls> Links for &Ls
50 type LinkIndex = Ls::LinkIndex;
52 fn next(links: &Self, index: Ls::LinkIndex) -> Option<Ls::LinkIndex> {
53 <Ls as Links>::next(links, index)
60 fn next(elem: &Self) -> Option<Self::LinkIndex>;
63 impl<L, E> Links for IndexVec<L, E>
65 E: LinkElem<LinkIndex = L>,
70 fn next(links: &Self, index: L) -> Option<L> {
71 <E as LinkElem>::next(&links[index])