FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    Selector

    struct · ferroui-base · v0.5.0

    struct Selector
    

    A selector in a Style.

    Selectors are built with the functions of Selectors and the chaining methods of this type. A selector is a shared, immutable description: cloning the handle is cheap.

    View source

    Members

    target_type

    fn target_type(self: &Self) -> Option<&'static TypeInfo>
    

    The target type of the selector, if available.

    Source

    match_

    fn match_(self: &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.

    Source

    to_string_with_owner

    fn to_string_with_owner(self: &Self, owner: Option<&Style>) -> String
    

    Gets a string representing the selector, with the nesting separator (^) replaced with the parent selector.

    Source

    child

    fn child(self: Self) -> Selector
    

    Returns a selector which matches this selector's child.

    Source

    class

    fn class(self: Self, name: &str) -> Selector
    

    Returns a selector which additionally matches a control's style class.

    Source

    descendant

    fn descendant(self: Self) -> Selector
    

    Returns a selector which matches a descendant of this selector.

    Source

    is

    fn is<T: ObjectType + Upcast<StyledElement>>(self: Self) -> Selector
    

    Returns a selector which additionally matches class T or a class derived from it.

    Source

    is_type_info

    fn is_type_info(self: Self, type_: &'static TypeInfo) -> Selector
    

    Returns a selector which additionally matches a type or a derived type.

    Source

    name

    fn name(self: Self, name: &str) -> Selector
    

    Returns a selector which additionally matches a control's name.

    Source

    nesting

    fn nesting(self: Self) -> Selector
    

    Returns the nesting selector.

    Source

    not

    fn not(self: Self, argument: Selector) -> Selector
    

    Returns a selector which additionally inverts the results of argument.

    Source

    not_with

    fn not_with(self: Self, argument: impl FnOnce(Option<Selector>) -> Selector) -> Selector
    

    Returns a selector which additionally inverts the results of the selector built by argument.

    Source

    nth_child

    fn nth_child(self: Self, step: i32, offset: i32) -> Selector
    

    Returns a selector which additionally matches elements based on their position among a group of siblings.

    Source

    nth_last_child

    fn nth_last_child(self: 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.

    Source

    of_type

    fn of_type<T: ObjectType + Upcast<StyledElement>>(self: Self) -> Selector
    

    Returns a selector which additionally matches class T exactly.

    Source

    of_type_info

    fn of_type_info(self: Self, type_: &'static TypeInfo) -> Selector
    

    Returns a selector which additionally matches a type.

    Source

    property_equals

    fn property_equals<T: PropertyValue>(self: Self, property: &'static StyledProperty<T>, value: T) -> Selector
    

    Returns a selector which additionally matches a control with the specified property value.

    Source

    property_equals_untyped

    fn property_equals_untyped(self: 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.

    Source

    template

    fn template(self: Self) -> Selector
    

    Returns a selector which enters a lookless control's template.

    Source

    Trait implementations

    • Send
    • Sync
    • Freeze
    • UnsafeUnpin
    • Unpin
    • UnwindSafe
    • RefUnwindSafe
    • PropertyValue
    • AnyValue
    • ClassDefaults
    • Borrow<T>
    • BorrowMut<T>
    • CloneToUninit
    • Into<U>
    • From<T>
    • TryInto<U>
    • TryFrom<U>
    • Any
    • ToOwned
    • ToString
    • ErasedDestructor
    • IntoEither
    • Clone
    • PartialEq
    • Display
    • Debug
    • MarkupTyped

    Availability

    Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.