FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    selection

    module · ferroui-controls · v0.5.0

    module selection
    

    Selection models.

    Inheritance among the selection classes

    The selection classes form a small hierarchy with virtual members (node base, selection model, internal selection model) but are plain shared structs, not part of the class model. Their virtual members are modelled explicitly, one level at a time:

    • SelectionNodeBase holds the state of the base class. Its inherent methods are the base implementations of the virtual members, which are declared by SelectionNodeBaseImpl. The base holds a weak reference to the object deriving from it and makes every virtual call through that reference.
    • SelectionModel embeds the node base and implements SelectionNodeBaseImpl. Its own implementation of each virtual member is the base_* method of the same name; the member can be overridden once more by a type deriving from the model, which implements SelectionModelImpl and registers itself with SelectionModel::set_derived. A virtual call reaches the override if there is one, the base_* method otherwise; an override calls the base_* method where the managed code calls the base implementation.
    • InternalSelectionModel owns an untyped model, overrides the assignment of the source and the handling of source collection changes through SelectionModelImpl, and dereferences to the model.

    The typed model is SelectionModel<T>; items are Option<T>, a null item being None. The untyped model is SelectionModel<BoxedValue>. ISelectionModel is the untyped contract implemented by every model.

    View source

    Contents

    Availability

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