pub enum Selector {
Show 13 variants
Root,
Widget(SelectorWidget),
WidgetDirectChild(SelectorWidget),
WidgetDirectAfter(SelectorWidget),
WidgetAfter(SelectorWidget),
NthMod(usize, usize),
NthLastMod(usize, usize),
Nth(usize),
NthLast(usize),
OnlyChild,
Class(String),
State(StyleState<String>),
Not(Box<Selector>),
}
Expand description
A selector that selects widgets that match some property.
Variants§
Root
Should be ignored when building
Widget(SelectorWidget)
Match a widget
WidgetDirectChild(SelectorWidget)
Match a widget that is a direct child of the parent
WidgetDirectAfter(SelectorWidget)
Match a widget that follows directly after the previous widget
WidgetAfter(SelectorWidget)
Match a widget that follows after a previous widget
NthMod(usize, usize)
Match the nth child widget modulo a number
NthLastMod(usize, usize)
Match the nth child widget counted from the last child widget modulo a number
Nth(usize)
Match the nth child widget
NthLast(usize)
Match the nth child widget counted from the last child widget
OnlyChild
Match widgets that are the only child of their parent
Class(String)
Match widgets that have a class
State(StyleState<String>)
Match widgets that are in a state
Not(Box<Selector>)
Invert the nested selector
Implementations§
Source§impl Selector
impl Selector
Sourcepub fn match_sibling(&self, direct: bool, widget: &str) -> Option<bool>
pub fn match_sibling(&self, direct: bool, widget: &str) -> Option<bool>
Match a sibling widget of the current rule. If this selector is not a sibling selector None
is returned.
Sourcepub fn match_child(&self, direct: bool, widget: &str) -> Option<bool>
pub fn match_child(&self, direct: bool, widget: &str) -> Option<bool>
Match a child widget of the current rule. If this selector is not a child selector None
is returned.
Sourcepub fn match_meta<S: AsRef<str>>(
&self,
state: &[StyleState<S>],
class: &str,
n: usize,
len: usize,
) -> Option<bool>
pub fn match_meta<S: AsRef<str>>( &self, state: &[StyleState<S>], class: &str, n: usize, len: usize, ) -> Option<bool>
Match parameters of the widget matched by the current rule.
If this selector is not a meta selector None
is returned.