Skip to main content

ProxyElement

Trait ProxyElement 

Source
pub trait ProxyElement: ComponentElement {
    // Required methods
    fn proxied_child(self: Handle<Self>, app: &App) -> WidgetRef;
    fn notify_clients(self: Handle<Self>, app: &mut App, old_widget: WidgetRef);

    // Provided methods
    fn updated(self: Handle<Self>, app: &mut App, old_widget: WidgetRef) { ... }
    fn update(self: Handle<Self>, app: &mut App, new_widget: WidgetRef) { ... }
}
Expand description

An Element that uses a ProxyWidget as its configuration.

Required Methods§

Source

fn proxied_child(self: Handle<Self>, app: &App) -> WidgetRef

The proxied child widget.

Source

fn notify_clients(self: Handle<Self>, app: &mut App, old_widget: WidgetRef)

Notify other objects that the widget associated with this element has changed.

Called during update (via updated) after changing the widget associated with this element but before rebuilding this element.

Provided Methods§

Source

fn updated(self: Handle<Self>, app: &mut App, old_widget: WidgetRef)

Called during build when the widget has changed.

By default, calls notify_clients. Subclasses may override this method to avoid calling notify_clients unnecessarily (e.g. if the old and new widgets are equivalent).

Source

fn update(self: Handle<Self>, app: &mut App, new_widget: WidgetRef)

ProxyElement.update.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§