FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    IBindableIndexer

    trait · ferroui-base · v0.5.0

    trait IBindableIndexer
    

    The untyped form of an indexer (this[..]), for bindings with an indexer in their path (Items[key], Grid[1,2]).

    A model type declares its indexer with ModelTypeBuilder::indexer. The binding converts the textual arguments of the path to the declared parameter types before calling get or set.

    A binding re-reads the indexer when the object raises a collection change notification, or a property change notification for the indexer (INDEXER_NAME).

    View source

    Members

    index_parameter_types

    fn index_parameter_types(self: &Self) -> Vec<ValueType>
    

    The types of the index parameters, in order.

    Source

    value_type

    fn value_type(self: &Self) -> ValueType
    

    The type of the values of the indexer.

    Source

    can_set

    fn can_set(self: &Self) -> bool
    

    Whether the indexer has a setter.

    Source

    get

    fn get(self: &Self, arguments: &[BoxedValue]) -> Result<Option<BoxedValue>, BindingError>
    

    Reads the value at arguments, which hold exactly the declared parameter types. An error is what the getter of a managed indexer throws: a missing key, an index out of range.

    Source

    set

    fn set(self: &Self, arguments: &[BoxedValue], value: Option<&BoxedValue>) -> Result<bool, BindingError>
    

    Writes the value at arguments. Returns Ok(false) if the indexer has no setter.

    Source

    Trait implementations

    Availability

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