MCPcopy Create free account
hub / github.com/csskit/csskit / visit_node

Method visit_node

crates/css_ast/src/visit/mod.rs:143–148  ·  view source on GitHub ↗

Builds the [`VisitNode`] passed to every `Visit` callback for this node. `subtree_metadata` (eager) uses `metadata()` (self + subtree) so the prune gate can reject whole subtrees; `self_metadata`/properties are deferred to `&dyn` accessors so they only cost anything when a visitor actually reads them.

(&self)

Source from the content-addressed store, hash-verified

141 /// reject whole subtrees; `self_metadata`/properties are deferred to `&dyn` accessors so
142 /// they only cost anything when a visitor actually reads them.
143 fn visit_node(&self) -> VisitNode<'_>
144 where
145 Self: Sized,
146 {
147 VisitNode::new(self.to_span(), Self::NODE_ID, self.metadata(), self)
148 }
149}
150
151/// Blanket bridge so any [`QueryableNode`] can be held as a `&dyn` in [`VisitNode`].

Callers

nothing calls this directly

Implementers 6

mod.rscrates/css_ast/src/visit/mod.rs
counter_style.rscrates/css_ast/src/rules/counter_style
webkit.rscrates/css_ast/src/rules/webkit.rs
keyframes.rscrates/css_ast/src/rules/keyframes.rs
property.rscrates/css_ast/src/rules/property.rs
mod.rscrates/css_ast/src/rules/container/mod

Calls 2

to_spanMethod · 0.45
metadataMethod · 0.45

Tested by

no test coverage detected