pub struct SimpleSelector {
pub element: Option<String>,
pub classes: Vec<String>,
pub pseudo: Option<PseudoClass>,
}Expand description
One simple (non-compound) selector. AND-combined: button.primary:hover
fills element=Some("button"), classes=["primary"], pseudo=Hover.
Fields§
§element: Option<String>§classes: Vec<String>§pseudo: Option<PseudoClass>Implementations§
Source§impl SimpleSelector
impl SimpleSelector
Sourcepub fn specificity(&self) -> u32
pub fn specificity(&self) -> u32
CSS specificity for one simple selector: classes/pseudo each count 10, type selector counts 1, no IDs in v1.
Sourcepub fn matches_node(&self, node: &Node<'_>, state: Option<PseudoClass>) -> bool
pub fn matches_node(&self, node: &Node<'_>, state: Option<PseudoClass>) -> bool
Does this simple selector match a node in the given state?
Trait Implementations§
Source§impl Clone for SimpleSelector
impl Clone for SimpleSelector
Source§fn clone(&self) -> SimpleSelector
fn clone(&self) -> SimpleSelector
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 SimpleSelector
impl Debug for SimpleSelector
Source§impl Default for SimpleSelector
impl Default for SimpleSelector
Source§fn default() -> SimpleSelector
fn default() -> SimpleSelector
Returns the “default value” for a type. Read more
Source§impl PartialEq for SimpleSelector
impl PartialEq for SimpleSelector
Source§fn eq(&self, other: &SimpleSelector) -> bool
fn eq(&self, other: &SimpleSelector) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for SimpleSelector
Auto Trait Implementations§
impl Freeze for SimpleSelector
impl RefUnwindSafe for SimpleSelector
impl Send for SimpleSelector
impl Sync for SimpleSelector
impl Unpin for SimpleSelector
impl UnsafeUnpin for SimpleSelector
impl UnwindSafe for SimpleSelector
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