pub struct Scope { /* private fields */ }Implementations§
Source§impl Scope
impl Scope
pub fn id(&self) -> InstanceId
pub fn owner(&self) -> &Owner
Sourcepub fn has_task_host(&self) -> Result<bool, AccessError>
pub fn has_task_host(&self) -> Result<bool, AccessError>
Whether this live Scope has an explicitly installed task execution service. This neither constructs/polls a future nor asks the host to perform work. An installed but closed/limited host still reports its normal spawn error.
pub fn child(&self) -> Self
pub fn parent(&self) -> Option<InstanceId>
pub fn is_alive(&self) -> bool
Methods from Deref<Target = Owner>§
Sourcepub fn resource<K, T, E, F>(
&self,
source: impl Fn() -> K + 'static,
load: impl Fn(K) -> F + 'static,
) -> Resource<K, T, E>
pub fn resource<K, T, E, F>( &self, source: impl Fn() -> K + 'static, load: impl Fn(K) -> F + 'static, ) -> Resource<K, T, E>
Start/restart after tracked source-key changes at the effect phase. A missing Host produces Unavailable rather than a blocking fallback.
pub fn resource_seeded<K, T, E, F>( &self, source: impl Fn() -> K + 'static, load: impl Fn(K) -> F + 'static, seed: Option<ResourceSeed<K, T, E>>, ) -> Resource<K, T, E>
pub fn keyed_list<K: Clone + Eq + Hash + 'static, T: 'static>( &self, initial: Vec<T>, key: impl Fn(&T) -> K + 'static, ) -> Result<KeyedList<K, T>, ListError>
pub fn selector<K: Clone + Eq + Hash + 'static>( &self, source: Cage<Option<K>>, ) -> Result<Selector<K>, AccessError>
Sourcepub fn enter<R>(&self, f: impl FnOnce() -> R) -> R
pub fn enter<R>(&self, f: impl FnOnce() -> R) -> R
Derived maps created by this widget/factory belong to this owner, even when their source is application-wide. The context never owns data.
pub fn runtime(&self) -> RuntimeId
pub fn is_alive(&self) -> bool
Sourcepub fn check_write(&self) -> Result<(), AccessError>
pub fn check_write(&self) -> Result<(), AccessError>
Check liveness and mutation permission before an adapter changes host state. This publishes nothing and does not reserve a later source write.
pub fn child(&self) -> Self
pub fn dispose(&self)
Sourcepub fn on_cleanup(
&self,
cleanup: impl FnOnce() + 'static,
) -> Result<(), AccessError>
pub fn on_cleanup( &self, cleanup: impl FnOnce() + 'static, ) -> Result<(), AccessError>
Run untracked after this Owner and its descendants have been invalidated. Implicit map/path construction remains in the retired Owner and fails; explicit entry into another live Owner is allowed. Callbacks run without graph borrows, in reverse registration order (children before parents). A panic unwinds normally; there is no catch/retry of remaining callbacks.
pub fn cage<T: 'static>(&self, value: T) -> Cage<T>
Sourcepub fn compute<T>(&self, f: impl FnOnce() -> T) -> Result<T, AccessError>
pub fn compute<T>(&self, f: impl FnOnce() -> T) -> Result<T, AccessError>
Synchronous, untracked pure computation under this live Owner. Allocates no reactive node. Both reads and unwind restore the outer tracking/mode/construction context; writes/creation remain forbidden.
pub fn bond<T: 'static>(&self, mapper: impl Fn() -> T + 'static) -> Bond<T>
pub fn binding(&self, callback: impl FnMut() + 'static) -> BindingId
Sourcepub fn effect(&self, callback: impl FnMut() + 'static) -> BindingId
pub fn effect(&self, callback: impl FnMut() + 'static) -> BindingId
Effects run after currently queued bindings. Writes enqueue another pass; reads still form direct dependencies, and runaway loops fail explicitly.
Sourcepub fn structural(&self, callback: impl FnMut() + 'static) -> BindingId
pub fn structural(&self, callback: impl FnMut() + 'static) -> BindingId
Structural controllers update owned row state before prop bindings run. Use this for tree control flow; ordinary computed props remain pure.