pub struct Selector(/* private fields */);Expand description
Implementations§
Source§impl Selector
impl Selector
Sourcepub fn target_type(&self) -> Option<&'static TypeInfo>
pub fn target_type(&self) -> Option<&'static TypeInfo>
The target type of the selector, if available.
Sourcepub fn match_(
&self,
control: &StyledElement,
parent: Option<&StyleBase>,
subscribe: bool,
) -> SelectorMatch
pub fn match_( &self, control: &StyledElement, parent: Option<&StyleBase>, subscribe: bool, ) -> SelectorMatch
Tries to match the selector with a control.
parent is the parent style, if the style containing the selector is
a nested style. With subscribe, a match whose state can change over
time carries an activator that tracks it; without, the match is only
evaluated for the current state.
Sourcepub fn to_string_with_owner(&self, owner: Option<&Style>) -> String
pub fn to_string_with_owner(&self, owner: Option<&Style>) -> String
Gets a string representing the selector, with the nesting separator
(^) replaced with the parent selector.
Source§impl Selector
impl Selector
Sourcepub fn class(self, name: &str) -> Selector
pub fn class(self, name: &str) -> Selector
Returns a selector which additionally matches a control’s style class.
Sourcepub fn descendant(self) -> Selector
pub fn descendant(self) -> Selector
Returns a selector which matches a descendant of this selector.
Sourcepub fn is<T: ObjectType + Upcast<StyledElement>>(self) -> Selector
pub fn is<T: ObjectType + Upcast<StyledElement>>(self) -> Selector
Returns a selector which additionally matches class T or a class
derived from it.
Sourcepub fn is_type_info(self, type_: &'static TypeInfo) -> Selector
pub fn is_type_info(self, type_: &'static TypeInfo) -> Selector
Returns a selector which additionally matches a type or a derived type.
Sourcepub fn name(self, name: &str) -> Selector
pub fn name(self, name: &str) -> Selector
Returns a selector which additionally matches a control’s name.
Sourcepub fn not(self, argument: Selector) -> Selector
pub fn not(self, argument: Selector) -> Selector
Returns a selector which additionally inverts the results of
argument.
Sourcepub fn not_with(
self,
argument: impl FnOnce(Option<Selector>) -> Selector,
) -> Selector
pub fn not_with( self, argument: impl FnOnce(Option<Selector>) -> Selector, ) -> Selector
Returns a selector which additionally inverts the results of the
selector built by argument.
Sourcepub fn nth_child(self, step: i32, offset: i32) -> Selector
pub fn nth_child(self, step: i32, offset: i32) -> Selector
Returns a selector which additionally matches elements based on their position among a group of siblings.
Sourcepub fn nth_last_child(self, step: i32, offset: i32) -> Selector
pub fn nth_last_child(self, step: i32, offset: i32) -> Selector
Returns a selector which additionally matches elements based on their position among a group of siblings, counting from the end.
Sourcepub fn of_type<T: ObjectType + Upcast<StyledElement>>(self) -> Selector
pub fn of_type<T: ObjectType + Upcast<StyledElement>>(self) -> Selector
Returns a selector which additionally matches class T exactly.
Sourcepub fn of_type_info(self, type_: &'static TypeInfo) -> Selector
pub fn of_type_info(self, type_: &'static TypeInfo) -> Selector
Returns a selector which additionally matches a type.
Sourcepub fn property_equals<T: PropertyValue>(
self,
property: &'static StyledProperty<T>,
value: T,
) -> Selector
pub fn property_equals<T: PropertyValue>( self, property: &'static StyledProperty<T>, value: T, ) -> Selector
Returns a selector which additionally matches a control with the specified property value.
Sourcepub fn property_equals_untyped(
self,
property: &'static FerroProperty,
value: BoxedValue,
) -> Selector
pub fn property_equals_untyped( self, property: &'static FerroProperty, value: BoxedValue, ) -> Selector
Returns a selector which additionally matches a control with the
specified property value. value must hold exactly the property’s
value type.
Trait Implementations§
Source§impl MarkupTyped for Selector
impl MarkupTyped for Selector
Source§const MARKUP: &'static MarkupType
const MARKUP: &'static MarkupType
Auto Trait Implementations§
impl !RefUnwindSafe for Selector
impl !Send for Selector
impl !Sync for Selector
impl !UnwindSafe for Selector
impl Freeze for Selector
impl Unpin for Selector
impl UnsafeUnpin for Selector
Blanket Implementations§
Source§impl<T> AnyValue for Twhere
T: PartialEq + 'static,
impl<T> AnyValue for Twhere
T: PartialEq + 'static,
fn any_value_as_any(&self) -> &(dyn Any + 'static)
fn any_value_eq(&self, other: &(dyn AnyValue + 'static)) -> bool
fn any_value_type_name(&self) -> &'static str
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
Source§impl<T> ClassDefaults for Twhere
T: ?Sized,
impl<T> ClassDefaults for Twhere
T: ?Sized,
Source§fn static_constructor()
fn static_constructor()
affects_render, metadata
overrides). Read more