FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    BindingHooks

    struct · ferroui-reactiveui · v0.5.0

    struct BindingHooks
    

    Lets a registered IPropertyBindingHook inspect, or refuse, a binding as it is created (BindingHooks).

    A hook is consulted once per binding, before anything is wired, and a hook that returns false cancels the binding. Hooks are registered in AppLocator, so the set is only known at run time: it is read on first use and kept until refresh. any is the guard a binding tests first, so that it builds the readers should_bind takes only when a hook exists.

    View source

    Members

    any

    fn any() -> bool
    

    Whether any hook was registered when the hooks were last read (Any).

    Source

    refresh

    fn refresh()
    

    Discards the cached hooks, so that the next use reads them from the locator again (Refresh).

    Source

    should_bind

    fn should_bind(source: Option<&Rc<dyn Any>>, target: &Rc<dyn Any>, get_source_properties: &dyn Fn() -> BindingHookChanges, get_target_properties: &dyn Fn() -> BindingHookChanges, direction: BindingDirection) -> bool
    

    Asks the registered hooks in turn whether this binding may be created, stopping at the first refusal (ShouldBind): true when the binding may proceed, including when no hook is registered.

    source is the view model (None when there is none), target the view; get_source_properties and get_target_properties read the current values along each path.

    Source

    Trait implementations

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

    Availability

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