Skip to main content

ModelWatchExt

Trait ModelWatchExt 

Source
pub trait ModelWatchExt {
    type WatchedModel<'cx, 'm, T: Any>
       where Self: 'cx;

    // Required method
    fn watch_model<'cx, 'm, T: Any>(
        &'cx mut self,
        model: &'m Model<T>,
    ) -> Self::WatchedModel<'cx, 'm, T>;
}
Expand description

Ergonomic helpers for observing-and-reading models during declarative rendering.

This is intentionally a component-layer API (ADR 0066): it provides sugar on top of fret-ui’s explicit observe_model(..., Invalidation) contract (ADR 0051).

Required Associated Types§

Source

type WatchedModel<'cx, 'm, T: Any> where Self: 'cx

Required Methods§

Source

fn watch_model<'cx, 'm, T: Any>( &'cx mut self, model: &'m Model<T>, ) -> Self::WatchedModel<'cx, 'm, 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<'a, H: UiHost> ModelWatchExt for ElementContext<'a, H>

Source§

type WatchedModel<'cx, 'm, T: Any> = WatchedModel<'cx, 'm, 'a, H, T> where Self: 'cx