pub struct CanonicalSelectorAst { /* private fields */ }Expand description
The sole selector canonicalization authority.
Construction accepts parser CST nodes, so quoted, escaped, and attribute interiors never need to be rediscovered by a string replacement pass.
Implementations§
Source§impl CanonicalSelectorAst
impl CanonicalSelectorAst
pub fn from_cst(selector_node: &SyntaxNode) -> Option<Self>
pub fn branches(&self) -> &[CanonicalSelectorBranchV0]
pub fn nesting_token_count(&self) -> usize
pub fn canonical_class_keys(&self) -> impl Iterator<Item = &CanonicalClassKeyV0>
Sourcepub fn canonical_class_key_for_source_span(
&self,
semantic_name: &str,
source_byte_range: Range<usize>,
nesting_parent_name: Option<&str>,
) -> Option<CanonicalClassKeyV0>
pub fn canonical_class_key_for_source_span( &self, semantic_name: &str, source_byte_range: Range<usize>, nesting_parent_name: Option<&str>, ) -> Option<CanonicalClassKeyV0>
Issues a sealed class key only when the parser-owned selector AST covers the source fact that produced the projected semantic name.
pub fn expand_with_parent(&self, parent: &Self) -> Option<String>
Trait Implementations§
Source§impl Clone for CanonicalSelectorAst
impl Clone for CanonicalSelectorAst
Source§fn clone(&self) -> CanonicalSelectorAst
fn clone(&self) -> CanonicalSelectorAst
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CanonicalSelectorAst
impl Debug for CanonicalSelectorAst
impl Eq for CanonicalSelectorAst
Source§impl PartialEq for CanonicalSelectorAst
impl PartialEq for CanonicalSelectorAst
impl StructuralPartialEq for CanonicalSelectorAst
Auto Trait Implementations§
impl Freeze for CanonicalSelectorAst
impl RefUnwindSafe for CanonicalSelectorAst
impl Send for CanonicalSelectorAst
impl Sync for CanonicalSelectorAst
impl Unpin for CanonicalSelectorAst
impl UnsafeUnpin for CanonicalSelectorAst
impl UnwindSafe for CanonicalSelectorAst
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.