pub struct WakeScope { /* private fields */ }Implementations§
Source§impl WakeScope
impl WakeScope
pub fn new() -> Self
pub fn revision(&self) -> u64
pub fn handle(&self) -> WakeHandle
Sourcepub fn run_inside(&self, host: &WakeHandle)
pub fn run_inside(&self, host: &WakeHandle)
This scope runs inside host’s, as a component runs inside the window that hosts it:
a reply this scope is owed, the host is owed too, so a host settling what it is owed
(WakeHandle::settle) waits for the replies of the work it runs. A scope runs inside
one host.
pub fn enter(&self) -> WakeScopeGuard
pub fn enter_detached() -> WakeScopeGuard
Sourcepub fn bind(
&mut self,
sink: impl Fn(WakeEvent) + Send + Sync + 'static,
) -> Result<(), WakeBindError>
pub fn bind( &mut self, sink: impl Fn(WakeEvent) + Send + Sync + 'static, ) -> Result<(), WakeBindError>
Bind a destination for this scope’s wakes, flushing work that arrived before startup. The sink must capture a sender or proxy, never an owning host reference.
§Errors
WakeBindError::Closed once the scope has closed,
WakeBindError::AlreadyBound when a destination is already installed.
Sourcepub fn take_unbound(&self) -> Option<(bool, bool)>
pub fn take_unbound(&self) -> Option<(bool, bool)>
Wakes recorded while no destination was bound, as (pending, requires_sync).
None when they are not observable here, so a caller must assume a
model-dirty wake.
Sourcepub fn take_pending(&self) -> Option<(bool, bool)>
pub fn take_pending(&self) -> Option<(bool, bool)>
Take the owner’s coalesced wake flags, including the wakes its event sink
received; None once the scope has closed.
pub fn is_pending(&self) -> bool
Sourcepub fn sync_pending(&self) -> Option<bool>
pub fn sync_pending(&self) -> Option<bool>
Whether the waiting wake asks for a model pass, without taking it: an owner that drains wakes mid-pass keeps it pending.