FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    DelayedBinding

    struct · ferroui-markup · v0.5.0

    struct DelayedBinding
    

    Provides delayed bindings for elements.

    The markup engine applies its bindings in a delayed manner: bindings are only applied when an element has finished initializing. Applying bindings as soon as elements are created would mean that long-form bindings (binding objects whose properties are set one by one after creation) don't work, as the binding would be applied to the property before the properties of the binding object are set.

    View source

    Members

    add

    fn add(target: &StyledElement, property: &'static FerroProperty, binding: Rc<dyn BindingBase>)
    

    Adds a delayed binding to an element: the binding is applied to property when the element has finished initializing, or immediately if it already has.

    Source

    add_value

    fn add_value(target: &StyledElement, property: Rc<dyn IPropertyInfo>, value: impl Fn(&StyledElement) -> Option<BoxedValue> + 'static) -> Result<(), BindingError>
    

    Adds a delayed value to an element: value is evaluated and written to property when the element has finished initializing, or immediately if it already has.

    When the value is written immediately, an error from the property setter is returned (the equivalent of the setter throwing to the caller); when it is written later, the error is logged.

    Source

    prepare_values

    fn prepare_values(control: &StyledElement) -> Result<(), BindingError>
    

    Resolves deferred markup values on a detached reload candidate without activating its data bindings or raising Initialized. Unlike ordinary initialization, setter errors abort preparation instead of being logged.

    Source

    apply_bindings

    fn apply_bindings(control: &StyledElement)
    

    Applies any delayed bindings to an element.

    Source

    Trait implementations

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

    Availability

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