pub struct SelectorExplanation {
pub source: String,
pub specificity: Specificity,
pub description: String,
pub performance_notes: Vec<String>,
pub hints: Vec<OptimizationHint>,
pub estimated_matches: Option<usize>,
}Expand description
Detailed explanation of a CSS selector.
Fields§
§source: StringThe original selector string.
specificity: SpecificityParsed specificity.
description: StringHuman-readable description of what the selector matches.
performance_notes: Vec<String>Performance characteristics.
hints: Vec<OptimizationHint>Optimization suggestions.
estimated_matches: Option<usize>Estimated match count (if document provided).
Implementations§
Source§impl SelectorExplanation
impl SelectorExplanation
Sourcepub fn analyze(selector: &CompiledSelector) -> Self
pub fn analyze(selector: &CompiledSelector) -> Self
Creates a new selector explanation by analyzing the selector.
§Performance
This function is O(n) where n is the selector length. Target: <1ms for typical selectors.
Sourcepub fn analyze_with_document(
selector: &CompiledSelector,
doc: &Document,
) -> Self
pub fn analyze_with_document( selector: &CompiledSelector, doc: &Document, ) -> Self
Creates explanation with estimated match count from a document.
Trait Implementations§
Source§impl Clone for SelectorExplanation
impl Clone for SelectorExplanation
Source§fn clone(&self) -> SelectorExplanation
fn clone(&self) -> SelectorExplanation
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for SelectorExplanation
impl RefUnwindSafe for SelectorExplanation
impl Send for SelectorExplanation
impl Sync for SelectorExplanation
impl Unpin for SelectorExplanation
impl UnwindSafe for SelectorExplanation
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