pub struct WakeScope { /* private fields */ }Implementations§
Source§impl WakeScope
impl WakeScope
pub fn new() -> WakeScope
pub fn revision(&self) -> u64
pub fn handle(&self) -> WakeHandle
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.
pub fn accepts(&self, event: &WakeEvent) -> bool
pub fn close(&mut self)
Trait Implementations§
Auto Trait Implementations§
impl Forget for WakeScope
impl Freeze for WakeScope
impl Move for WakeScope
impl RefUnwindSafe for WakeScope
impl Send for WakeScope
impl Sync for WakeScope
impl Unpin for WakeScope
impl UnsafeUnpin for WakeScope
impl UnwindSafe for WakeScope
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more