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.
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.
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.
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.
apply_bindings
fn apply_bindings(control: &StyledElement)
Applies any delayed bindings to an element.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeBorrow<T>BorrowMut<T>Into<U>From<T>TryInto<U>TryFrom<U>AnyClassDefaultsErasedDestructorIntoEither
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.