Skip to main content

Module subcompose

Module subcompose 

Source
Expand description

State tracking for measure-time subcomposition.

The SubcomposeState keeps book of which slots are active, which nodes can be reused, and which precompositions need to be disposed. Reuse follows a two-phase lookup: first SlotIds that match exactly are preferred. If no exact match exists, the SlotReusePolicy is consulted to determine whether a node produced for another slot is compatible with the requested slot.

Structs§

ContentTypeReusePolicy
Reuse policy that allows cross-slot reuse when content types match.
DefaultSlotReusePolicy
Default reuse policy that mirrors Jetpack Compose behaviour: dispose everything from the tail so that the next measurement can decide which content to keep alive. Compatibility defaults to exact slot matches.
SlotId
Identifier for a subcomposed slot.
SubcomposeDisposal
Evicted roots and the slot state that stays alive until their nodes are disposed. Pass this batch to crate::Composer::dispose_subcomposed_nodes.
SubcomposeState
Tracks the state of nodes produced by subcomposition, enabling reuse between measurement passes.
TypedSlot
A slot with the content type registered for it, if any: what a SlotReusePolicy decides reuse by.

Traits§

SlotReusePolicy
Policy that decides which previously composed slots should be retained for potential reuse during the next subcompose pass.

Type Aliases§

DebugSlotGroup
One group of a slot table, for debugging: the group index, its call site key, its scope id and the length of its subtree.