Struct style::stylist::Rule [] [src]

pub struct Rule {
    pub selector: Selector<SelectorImpl>,
    pub hashes: AncestorHashes,
    pub source_order: u32,
    pub style_rule: Arc<Locked<StyleRule>>,
}

A rule, that wraps a style rule, but represents a single selector of the rule.

Fields

The selector this struct represents. We store this and the any_{important,normal} booleans inline in the Rule to avoid pointer-chasing when gathering applicable declarations, which can ruin performance when there are a lot of rules.

The ancestor hashes associated with the selector.

The source order this style rule appears in. Note that we only use three bytes to store this value in ApplicableDeclarationsBlock, so we could repurpose that storage here if we needed to.

The actual style rule.

Methods

impl Rule
[src]

[src]

Returns the specificity of the rule.

[src]

Turns this rule into an ApplicableDeclarationBlock for the given cascade level.

[src]

Creates a new Rule.

Trait Implementations

impl Clone for Rule
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl Debug for Rule
[src]

[src]

Formats the value using the given formatter. Read more

impl MallocSizeOf for Rule
[src]

[src]

Measure the heap usage of all descendant heap-allocated structures, but not the space taken up by the value itself. Read more

impl SelectorMapEntry for Rule
[src]

Important traits for SelectorIter<'a, Impl>
[src]

Gets the selector we should use to index in the selector map.