Struct WakeScope
pub struct WakeScope { /* private fields */ }Expand description
The non-clone owner of one mount incarnation. Drop closes it.
Implementations§
§impl WakeScope
impl WakeScope
pub fn new() -> WakeScope
pub fn handle(&self) -> WakeHandle
pub fn enter(&self) -> WakeScopeGuard
pub fn enter(&self) -> WakeScopeGuard
Enter during construction or app callbacks; drop guards in reverse order.
pub fn enter_detached() -> WakeScopeGuard
pub fn enter_detached() -> WakeScopeGuard
Enter intentional headless/no-host execution, masking an outer scope. Drop guards in reverse entry order, on this thread. Captures made here stay detached after the previous construction context is restored.
pub 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 once and flush one wake if work arrived before startup. The sink must capture a sender/proxy, never an owning host reference.
§Errors
Returns WakeBindError::Closed when the scope has already closed, or
WakeBindError::AlreadyBound when a destination is already installed.
pub fn take_unbound(&self) -> Option<(bool, bool)>
pub fn take_unbound(&self) -> Option<(bool, bool)>
Drain wakes recorded while no destination is bound, as
(pending, requires_sync). A hosted application worker has no event
loop: its model pump is the consumer. None means the wakes are not
observable here (a sink is bound and received them, or the scope is
closed), so a caller must assume a model-dirty wake.
pub fn take_pending(&self) -> Option<(bool, bool)>
pub fn take_pending(&self) -> Option<(bool, bool)>
Drain the owner’s coalesced wake flags, including wakes delivered to
its event sink. An embedded application uses these flags to distinguish
presentation frames from model changes. Sink delivery and receiver-side
authorization still run normally. A closed scope returns None.
pub fn accepts(&self, event: &WakeEvent) -> bool
pub fn accepts(&self, event: &WakeEvent) -> bool
Receiver-side validation remains mandatory after sender-side checks.
pub fn close(&mut self)
pub fn close(&mut self)
Stop new authorizations without waiting for previously accepted work.
Trait Implementations§
Auto Trait Implementations§
impl Freeze 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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
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>
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