pub struct Selector {
pub id: Option<String>,
pub element: Option<String>,
pub classes: HashSet<String>,
pub pseudo_classes: HashSet<String>,
pub relation: Option<Box<SelectorRelation>>,
pub dirty: bool,
}
Expand description
Describes a css selector.
Fields§
§id: Option<String>
§element: Option<String>
§classes: HashSet<String>
§pseudo_classes: HashSet<String>
§relation: Option<Box<SelectorRelation>>
§dirty: bool
Implementations§
Source§impl Selector
Inner selector value.
impl Selector
Inner selector value.
pub fn new() -> Self
pub fn is_empty(&self) -> bool
pub fn dirty(&self) -> bool
pub fn set_dirty(&mut self, dirty: bool)
pub fn specificity(&self) -> Specificity
pub fn matches(&self, other: &Selector) -> bool
pub fn with<S: Into<String>>(self, element: S) -> Self
pub fn id<S: Into<String>>(self, id: S) -> Self
pub fn class<S: Into<String>>(self, class: S) -> Self
pub fn without_class<S: Into<String>>(self, class: S) -> Self
pub fn pseudo_class<S: Into<String>>(self, pseudo_class: S) -> Self
pub fn without_pseudo_class<S: Into<String>>(self, pseudo_class: S) -> Self
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Selector
impl RefUnwindSafe for Selector
impl Send for Selector
impl Sync for Selector
impl Unpin for Selector
impl UnwindSafe for Selector
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