pub struct RecomposeScope { /* private fields */ }Expand description
The unit of recomposition. State read inside a scope invalidates it, and a recomposition runs only the content of the invalid scopes. Clones refer to the same scope.
Implementations§
Source§impl RecomposeScope
impl RecomposeScope
Sourcepub fn is_invalid(&self) -> bool
pub fn is_invalid(&self) -> bool
Returns true if state that the scope read has changed since it last recomposed.
Sourcepub fn owner_chain_deactivation_epoch(&self) -> u64
pub fn owner_chain_deactivation_epoch(&self) -> u64
Total deactivations along this scope’s owner chain. A retained slot composition records this at compose time; a later mismatch means some enclosing composition was deactivated (its owned effects cancelled) since the slot last composed, so the retained content must recompose once to restart them — no flag on the slot’s own scopes carries that trace, because deactivation walks stop at slot-host boundaries.
Sourcepub fn deactivate(&self)
pub fn deactivate(&self)
Marks the scope inactive, as when its content is retained or held for reuse. An inactive scope is not queued for recomposition until it is reactivated.
Sourcepub fn reactivate(&self)
pub fn reactivate(&self)
Marks the scope active again and queues it for recomposition if it was invalidated while inactive.
Sourcepub fn force_reuse(&self)
pub fn force_reuse(&self)
Makes the next should_recompose return false even if the scope is invalid. Cancels a
pending force_recompose.
Sourcepub fn force_recompose(&self)
pub fn force_recompose(&self)
Makes the next should_recompose return true even if the scope is not invalid. Cancels a
pending force_reuse.
Sourcepub fn should_recompose(&self) -> bool
pub fn should_recompose(&self) -> bool
Returns whether the scope’s content has to run now: true after force_recompose or when
the scope is invalid, and false after force_reuse. A forced answer is used up by the
call.
Sourcepub fn has_composed_once(&self) -> bool
pub fn has_composed_once(&self) -> bool
Returns true once the scope has composed its content at least once.