pub(crate) fn with_parent(self, parent: Pattern) -> Pattern {
        let Pattern { kinds, pred } = self;
        Pattern::new(kinds, move |element| {
            (pred)(element) && element.parent().map(|it| parent.matches(&it.into())) == Some(true)
        })
    }
/// Creates a pattern which matches the same elements as `self` with the
/// additional constraint that their parent matches `parent`.
Creates a pattern which matches the same elements as `self` with the
additional constraint that their parent matches `parent`.
Creates a pattern which matches the same elements as ` self ` with the additional constraint that their parent matches ` parent ` .
pub(crate) fn with_parent(self, parent: Pattern) -> Pattern {
        let Pattern { kinds, pred } = self;
        Pattern::new(kinds, move |element| {
            (pred)(element) && element.parent().map(|it| parent.matches(&it.into())) == Some(true)
        })
    }
pub ( crate ) fn with_parent ( self , parent : Pattern ) -> Pattern { let Pattern { kinds , pred } = self ; Pattern :: new ( kinds , move | element | { ( pred ) ( element ) && element . parent ( ) . map ( | it | parent . matches ( & it . into ( ) ) ) == Some ( true ) } ) }
Creates a pattern which matches the same elements as `self` with the
additional constraint that their parent matches `parent`.
Creates a pattern which matches the same elements as ` self ` with the additional constraint that their parent matches ` parent ` .
self
parent
Pattern