FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    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>();
    

    View source

    Members

    child

    fn child(previous: Option<Selector>) -> Selector
    

    Returns a selector which matches a previous selector's child.

    Source

    class

    fn class(previous: Option<Selector>, name: &str) -> Selector
    

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

    Source

    descendant

    fn descendant(previous: Option<Selector>) -> Selector
    

    Returns a selector which matches a descendant of a previous selector.

    Source

    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.

    Source

    is

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

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

    Source

    name

    fn name(previous: Option<Selector>, name: &str) -> Selector
    

    Returns a selector which matches a control's name.

    Source

    nesting

    fn nesting(_previous: Option<Selector>) -> Selector
    

    Returns the nesting selector, which stands for the selector of the parent style.

    Source

    not

    fn not(previous: Option<Selector>, argument: Selector) -> Selector
    

    Returns a selector which inverts the results of selector argument.

    Source

    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.

    Source

    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.

    Source

    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.

    Source

    of_type_info

    fn of_type_info(previous: Option<Selector>, type_: &'static TypeInfo) -> Selector
    

    Returns a selector which matches a type.

    Source

    of_type

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

    Returns a selector which matches class T exactly.

    Source

    or

    fn or(selectors: impl IntoIterator<Item = Selector>) -> Selector
    

    Returns a selector which ORs selectors.

    Source

    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.

    Source

    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.

    Source

    template

    fn template(previous: Option<Selector>) -> Selector
    

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

    Source

    Trait implementations

    • Send
    • Sync
    • Freeze
    • UnsafeUnpin
    • Unpin
    • UnwindSafe
    • RefUnwindSafe
    • ClassDefaults
    • Borrow<T>
    • BorrowMut<T>
    • Into<U>
    • From<T>
    • TryInto<U>
    • TryFrom<U>
    • Any
    • ErasedDestructor
    • IntoEither
    • MarkupTyped

    Availability

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