[−][src]Trait selectors::visitor::Visit
Enables traversing selector components stored in various types
Associated Types
type Impl: SelectorImpl
The type parameter of selector component types.
Required methods
fn visit<V>(&self, visitor: &mut V) -> bool where
V: SelectorVisitor<Impl = Self::Impl>,
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
Implementors
impl<Impl: SelectorImpl> Visit for Component<Impl> where
Impl::NonTSPseudoClass: Visit<Impl = Impl>,
[src]
Impl::NonTSPseudoClass: Visit<Impl = Impl>,
type Impl = Impl
fn visit<V>(&self, visitor: &mut V) -> bool where
V: SelectorVisitor<Impl = Impl>,
[src]
V: SelectorVisitor<Impl = Impl>,
impl<Impl: SelectorImpl> Visit for Selector<Impl> where
Impl::NonTSPseudoClass: Visit<Impl = Impl>,
[src]
Impl::NonTSPseudoClass: Visit<Impl = Impl>,