Skip to main content

CachedSubtreeExt

Trait CachedSubtreeExt 

Source
pub trait CachedSubtreeExt {
    type Host: UiHost;

    // Required method
    fn cached_subtree_with<I, T>(
        &mut self,
        props: CachedSubtreeProps,
        f: impl FnOnce(&mut Self) -> I,
    ) -> AnyElement
       where I: IntoIterator<Item = T>,
             T: IntoUiElement<Self::Host>;

    // Provided method
    fn cached_subtree<I, T>(
        &mut self,
        f: impl FnOnce(&mut Self) -> I,
    ) -> AnyElement
       where I: IntoIterator<Item = T>,
             T: IntoUiElement<Self::Host> { ... }
}
Expand description

Component-layer helper for authoring explicit cached subtree boundaries.

This intentionally lives in the ecosystem layer (ADR 0066): it is sugar on top of the mechanism-only ElementContext::view_cache(...) API in fret-ui.

Required Associated Types§

Required Methods§

Source

fn cached_subtree_with<I, T>( &mut self, props: CachedSubtreeProps, f: impl FnOnce(&mut Self) -> I, ) -> AnyElement
where I: IntoIterator<Item = T>, T: IntoUiElement<Self::Host>,

Build an explicit cached subtree boundary with additional cache-root hints.

Provided Methods§

Source

fn cached_subtree<I, T>(&mut self, f: impl FnOnce(&mut Self) -> I) -> AnyElement
where I: IntoIterator<Item = T>, T: IntoUiElement<Self::Host>,

Build an explicit cached subtree boundary using default cache-root behavior.

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§