FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    typed_path

    module · ferroui-base · v0.5.0

    module typed_path
    

    The typed path hook of a plain property declared in markup metadata.

    A compiled binding whose path is a single plain property of a model type is evaluated without boxing (TypedBindingExpression<TSource, TValue>) when the path element has typed accessors. Generated code builds such an element with CompiledBindingPathBuilder::typed_property::<S, V>(..); a path built at run time from metadata gets it from MarkupProperty::typed_path_element, which the declaration macros generate for every properties: entry from its accessors (none where the instance type cannot be a shared handle: a class of the object model, a value type declared as struct without this:, a contract without this:).

    The hook produces the typed element when the instance type of the declaration (this:) is Rc<S> with S: PartialEq (a shared reference type, the TSource : class of the managed original) and the property type is a property value type: an element that follows the property change notifications of the source when S: INotifyPropertyChanged, one that reads the value once per source otherwise. For every other declaration (value types, handles of contracts, classes of the object model, and a property of the untyped value type) it produces nothing and the caller uses the untyped element. The choice is made by method resolution at the declaration (the most specific form that applies is selected), so a declaration needs no syntax for it.

    View source

    Contents

    Availability

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