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
selector: Selector<SelectorImpl>
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.
hashes: AncestorHashes
The ancestor hashes associated with the selector.
source_order: u32
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.
style_rule: Arc<Locked<StyleRule>>
The actual style rule.
Methods
impl Rule
[src]
pub fn specificity(&self) -> u32
[src]
Returns the specificity of the rule.
pub fn to_applicable_declaration_block(
&self,
level: CascadeLevel
) -> ApplicableDeclarationBlock
[src]
&self,
level: CascadeLevel
) -> ApplicableDeclarationBlock
Turns this rule into an ApplicableDeclarationBlock
for the given
cascade level.
pub fn new(
selector: Selector<SelectorImpl>,
hashes: AncestorHashes,
style_rule: Arc<Locked<StyleRule>>,
source_order: u32
) -> Self
[src]
selector: Selector<SelectorImpl>,
hashes: AncestorHashes,
style_rule: Arc<Locked<StyleRule>>,
source_order: u32
) -> Self
Creates a new Rule.
Trait Implementations
impl Clone for Rule
[src]
fn clone(&self) -> Rule
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Debug for Rule
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl MallocSizeOf for Rule
[src]
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
[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>fn selector(&self) -> SelectorIter<SelectorImpl>
[src]
Gets the selector we should use to index in the selector map.