pub enum Selector {
Type(String),
Class(String),
Id(String),
Universal,
PseudoClass(PseudoClass),
Descendant(Box<Selector>, Box<Selector>),
Child(Box<Selector>, Box<Selector>),
Compound(Vec<Selector>),
}Expand description
TCSS selector — a single selector or combinator expression.
Variants§
Type(String)
Matches widgets by type name, e.g. Button
Class(String)
Matches widgets with a CSS class, e.g. .active
Id(String)
Matches widgets with a specific ID, e.g. #sidebar
Universal
Matches any widget (*)
PseudoClass(PseudoClass)
Matches widgets with a given pseudo-class, e.g. :focus
Descendant(Box<Selector>, Box<Selector>)
Matches a widget that is any descendant of the left selector, e.g. Screen Button
Child(Box<Selector>, Box<Selector>)
Matches a widget that is a direct child of the left selector, e.g. Container > Button
Compound(Vec<Selector>)
Multiple simple selectors that all apply to the same element, e.g. Button.active:focus
Implementations§
Source§impl Selector
impl Selector
Sourcepub fn specificity(&self) -> Specificity
pub fn specificity(&self) -> Specificity
Calculate specificity for this selector.
Trait Implementations§
impl StructuralPartialEq for Selector
Auto Trait Implementations§
impl Freeze for Selector
impl RefUnwindSafe for Selector
impl Send for Selector
impl Sync for Selector
impl Unpin for Selector
impl UnsafeUnpin 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> StorageAccess<T> for T
impl<T> StorageAccess<T> for T
Source§fn as_borrowed(&self) -> &T
fn as_borrowed(&self) -> &T
Borrows the value.
Source§fn into_taken(self) -> T
fn into_taken(self) -> T
Takes the value.