[][src]Trait selectors::visitor::Visit

pub trait Visit {
    type Impl: SelectorImpl;
    fn visit<V>(&self, visitor: &mut V) -> bool
    where
        V: SelectorVisitor<Impl = Self::Impl>
; }

Enables traversing selector components stored in various types

Associated Types

type Impl: SelectorImpl

The type parameter of selector component types.

Loading content...

Required methods

fn visit<V>(&self, visitor: &mut V) -> bool where
    V: SelectorVisitor<Impl = Self::Impl>, 

Traverse selector components inside self.

Implementations of this method should call SelectorVisitor methods or other impls of Visit as appropriate based on the fields of Self.

A return value of false indicates terminating the traversal. It should be propagated with an early return. On the contrary, true indicates that all fields of self have been traversed:

This example is not tested
if !visitor.visit_simple_selector(&self.some_simple_selector) {
    return false;
}
if !self.some_component.visit(visitor) {
    return false;
}
true
Loading content...

Implementors

impl<Impl: SelectorImpl> Visit for Component<Impl> where
    Impl::NonTSPseudoClass: Visit<Impl = Impl>, 
[src]

type Impl = Impl

impl<Impl: SelectorImpl> Visit for Selector<Impl> where
    Impl::NonTSPseudoClass: Visit<Impl = Impl>, 
[src]

type Impl = Impl

Loading content...