pub struct Selector {
pub id: Option<u64>,
pub element: Option<String>,
pub classes: HashSet<String>,
pub pseudo_classes: PseudoClasses,
pub relation: Relation,
pub asterisk: bool,
}Fields§
§id: Option<u64>§element: Option<String>§classes: HashSet<String>§pseudo_classes: PseudoClasses§relation: Relation§asterisk: boolImplementations§
Source§impl Selector
impl Selector
pub fn new() -> Selector
pub fn element(element: &str) -> Selector
pub fn matches(&self, entity_selector: &Selector) -> bool
pub fn specificity(&self) -> Specificity
pub fn id(self, id: &str) -> Selector
pub fn class(self, class: &str) -> Selector
pub fn replace_class(&mut self, old: &str, new: &str) -> &mut Selector
pub fn set_id(&mut self, id: &str) -> &mut Selector
pub fn set_element(&mut self, element: &str) -> &mut Selector
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