/// Iterate over all known components immediately under the specified `iter`
/// path.
Iterate over all known components immediately under the specified `iter`
path.
Iterate over all known components immediately under the specified ` iter ` path .
pub fn iter_components<'a, I: 'a>(
        &'a self,
        iter: I,
    ) -> impl Iterator<Item = ComponentRef<'a>> + 'a
    where
        I: IntoIterator,
        I::Item: IntoComponent,
    {
        let mut current = &self.root;
        for c in iter {
            let c = c.into_component();
            current = match current.children.get(&c) {
                Some(node) => node,
                None => return IterComponents(None),
            };
        }
        return IterComponents(Some(current.children.keys()));
        struct IterComponents<I>(Option<I>);
        impl<'a, I> Iterator for IterComponents<I>
        where
            I: Iterator<Item = &'a Component>,
        {
            type Item = ComponentRef<'a>;
            fn next(&mut self) -> Option<Self::Item> {
                let mut iter = self.0.take()?;
                let next = iter.next()?;
                self.0 = Some(iter);
                Some(next.as_component_ref())
            }
        }
    }
pub fn iter_components < ' a , I : ' a > ( & ' a self , iter : I , ) -> impl Iterator < Item = ComponentRef < ' a > > + ' a where I : IntoIterator , I :: Item : IntoComponent , { let mut current = & self . root ; for c in iter { let c = c . into_component ( ) ; current = match current . children . get ( & c ) { Some ( node ) => node , None => return IterComponents ( None ) , } ; } return IterComponents ( Some ( current . children . keys ( ) ) ) ; struct IterComponents < I > ( Option < I > ) ; impl < ' a , I > Iterator for IterComponents < I > where I : Iterator < Item = & ' a Component > , { type Item = ComponentRef < ' a > ; fn next ( & mut self ) -> Option < Self :: Item > { let mut iter = self . 0 . take ( ) ? ; let next = iter . next ( ) ? ; self . 0 = Some ( iter ) ; Some ( next . as_component_ref ( ) ) } } }
Iterate over all known components immediately under the specified `iter`
path.
Iterate over all known components immediately under the specified ` iter ` path .
&'a self
iter
I