Skip to main content

TrackedModelExt

Trait TrackedModelExt 

Source
pub trait TrackedModelExt<T: Any> {
    // Required method
    fn watch_in<'cx, 'a, H: UiHost>(
        &self,
        cx: &'cx mut ElementContext<'a, H>,
    ) -> WatchedModel<'cx, '_, 'a, H, T>;

    // Provided methods
    fn paint_in<'cx, 'a, H: UiHost>(
        &self,
        cx: &'cx mut ElementContext<'a, H>,
    ) -> WatchedModel<'cx, '_, 'a, H, T> { ... }
    fn layout_in<'cx, 'a, H: UiHost>(
        &self,
        cx: &'cx mut ElementContext<'a, H>,
    ) -> WatchedModel<'cx, '_, 'a, H, T> { ... }
    fn hit_test_in<'cx, 'a, H: UiHost>(
        &self,
        cx: &'cx mut ElementContext<'a, H>,
    ) -> WatchedModel<'cx, '_, 'a, H, T> { ... }
}
Expand description

Handle-first tracked-read helpers for helper-heavy ElementContext surfaces.

This stays in the component/declarative layer for the same reason as ModelWatchExt: it is sugar over the explicit observe_model(..., Invalidation) contract, not a new runtime mechanism.

Required Methods§

Source

fn watch_in<'cx, 'a, H: UiHost>( &self, cx: &'cx mut ElementContext<'a, H>, ) -> WatchedModel<'cx, '_, 'a, H, T>

Provided Methods§

Source

fn paint_in<'cx, 'a, H: UiHost>( &self, cx: &'cx mut ElementContext<'a, H>, ) -> WatchedModel<'cx, '_, 'a, H, T>

Source

fn layout_in<'cx, 'a, H: UiHost>( &self, cx: &'cx mut ElementContext<'a, H>, ) -> WatchedModel<'cx, '_, 'a, H, T>

Source

fn hit_test_in<'cx, 'a, H: UiHost>( &self, cx: &'cx mut ElementContext<'a, H>, ) -> WatchedModel<'cx, '_, 'a, H, T>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<T: Any> TrackedModelExt<T> for Model<T>