FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    FuncTreeDataTemplate

    struct · ferroui-controls · v0.5.0

    struct FuncTreeDataTemplate
    

    A template used to build hierarchical data.

    items_selector returns the child items of an item as the untyped value assigned to the target property, so it must hold exactly the value type of that property.

    View source

    Members

    new

    fn new(match_: impl Fn(Option<&BoxedValue>) -> bool + 'static, build: impl Fn(&Option<BoxedValue>, &NameScopeRef) -> Option<Ref<Control>> + 'static, items_selector: impl Fn(&BoxedValue) -> BoxedValue + 'static) -> Rc<Self>
    

    Creates a tree data template.

    Source

    for_type

    fn for_type<T: 'static>(build: impl Fn(&T, &NameScopeRef) -> Option<Ref<Control>> + 'static, items_selector: impl Fn(&T) -> BoxedValue + 'static) -> Rc<Self>
    

    Creates a tree data template that matches data of type T.

    Source

    for_type_with_match

    fn for_type_with_match<T: 'static>(match_: impl Fn(&T) -> bool + 'static, build: impl Fn(&T, &NameScopeRef) -> Option<Ref<Control>> + 'static, items_selector: impl Fn(&T) -> BoxedValue + 'static) -> Rc<Self>
    

    Creates a tree data template that matches data of type T accepted by match_.

    Source

    Trait implementations

    Availability

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