Selectors
struct · ferroui-base · v0.5.0
struct Selectors
Functions for building Selectors.
Every function takes the selector that precedes the new one (None to
start a selector). The same functions are available as chaining methods on
Selector:
// Button.big > :is(Control)
let selector = Selectors::of_type::<Button>().class("big").child().is::<Control>();
Members
childclassdescendantis_type_infoisnamenestingnotnot_withnth_childnth_last_childof_type_infoof_typeorproperty_equalsproperty_equals_untypedtemplate
child
fn child(previous: Option<Selector>) -> Selector
Returns a selector which matches a previous selector's child.
class
fn class(previous: Option<Selector>, name: &str) -> Selector
Returns a selector which matches a control's style class.
descendant
fn descendant(previous: Option<Selector>) -> Selector
Returns a selector which matches a descendant of a previous selector.
is_type_info
fn is_type_info(previous: Option<Selector>, type_: &'static TypeInfo) -> Selector
Returns a selector which matches a type or a derived type.
is
fn is<T: ObjectType + Upcast<StyledElement>>() -> Selector
Returns a selector which matches class T or a class derived from it.
name
fn name(previous: Option<Selector>, name: &str) -> Selector
Returns a selector which matches a control's name.
nesting
fn nesting(_previous: Option<Selector>) -> Selector
Returns the nesting selector, which stands for the selector of the parent style.
not
fn not(previous: Option<Selector>, argument: Selector) -> Selector
Returns a selector which inverts the results of selector argument.
not_with
fn not_with(previous: Option<Selector>, argument: impl FnOnce(Option<Selector>) -> Selector) -> Selector
Returns a selector which inverts the results of the selector built by
argument.
nth_child
fn nth_child(previous: Option<Selector>, step: i32, offset: i32) -> Selector
Returns a selector which matches elements based on their position among a group of siblings.
nth_last_child
fn nth_last_child(previous: Option<Selector>, step: i32, offset: i32) -> Selector
Returns a selector which matches elements based on their position among a group of siblings, counting from the end.
of_type_info
fn of_type_info(previous: Option<Selector>, type_: &'static TypeInfo) -> Selector
Returns a selector which matches a type.
of_type
fn of_type<T: ObjectType + Upcast<StyledElement>>() -> Selector
Returns a selector which matches class T exactly.
or
fn or(selectors: impl IntoIterator<Item = Selector>) -> Selector
Returns a selector which ORs selectors.
property_equals
fn property_equals<T: PropertyValue>(previous: Option<Selector>, property: &'static StyledProperty<T>, value: T) -> Selector
Returns a selector which matches a control with the specified property value.
property_equals_untyped
fn property_equals_untyped(previous: Option<Selector>, property: &'static FerroProperty, value: BoxedValue) -> Selector
Returns a selector which matches a control with the specified property
value. value must hold exactly the property's value type.
template
fn template(previous: Option<Selector>) -> Selector
Returns a selector which enters a lookless control's template.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeClassDefaultsBorrow<T>BorrowMut<T>Into<U>From<T>TryInto<U>TryFrom<U>AnyErasedDestructorIntoEitherMarkupTyped
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.