Struct WakeHandle
pub struct WakeHandle { /* private fields */ }Expand description
Captures one scope, or remains detached forever. Unlike a closed scope, detached execution may publish local/headless state without waking a host.
Implementations§
§impl WakeHandle
impl WakeHandle
pub fn new() -> WakeHandle
pub const fn detached() -> WakeHandle
pub fn is_active(&self) -> bool
pub fn wake(&self)
pub fn wake_save_progress(&self)
pub fn wake_save_progress(&self)
Wake the owner because a record’s save moved on (a write landed or
failed), and for nothing else. An owner that cannot tell wakes apart
takes it as Self::wake; one that can shows the save status
alone, without running its model again for a write that changed
nothing it holds.
pub fn owe(&self) -> Owed
pub fn owe(&self) -> Owed
Owe the owner a reply: work it asked for off its thread whose answer
it waits to take up, such as a worker’s reply to a request. The work
holds the Owed and drops it once its answer is queued for the
owner (or it ends without one), which wakes the owner.
What an action causes this way is part of the action: a host answers
the action once every reply owed meanwhile landed and was taken up
(Self::settle), so its effects are the action’s, not the next
one’s. Owe only short work answered by itself: long-running work an
action starts answers as a job instead, and nothing waits on a person
(a chooser) or on a stream that does not end. A detached handle, or
one whose scope closed, owes nothing.
pub fn begin_pass(&self)
pub fn begin_pass(&self)
Forget the replies that landed so far: the owner’s next pass takes
them up, and Self::settled after it asks only about later ones.
For an owner that cannot wait (Self::settle), such as a window
whose frames also serve a person: it marks where a pass begins and
asks once it ended.
pub fn settled(&self) -> bool
pub fn settled(&self) -> bool
Whether nothing is owed and no reply landed
since Self::begin_pass: a pass that began after it took up everything
that was owed. A closed or detached scope is settled; one that is not
is woken when a reply lands, so its owner asks again then.
pub fn settle(&self, pass: impl FnMut())
pub fn settle(&self, pass: impl FnMut())
Run pass, one turn of the owner’s loop that takes up whatever has
landed for it, until no reply is owed (Self::owe) and a pass ran
after the last one landed. Between passes it waits for the scope to
be woken: it never polls, and returns at once when the scope closes.
At least one pass runs: the one that takes up what the caller just
did. A detached handle runs that one.
Trait Implementations§
§impl Clone for WakeHandle
impl Clone for WakeHandle
§fn clone(&self) -> WakeHandle
fn clone(&self) -> WakeHandle
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for WakeHandle
impl Debug for WakeHandle
§impl Default for WakeHandle
impl Default for WakeHandle
§fn default() -> WakeHandle
fn default() -> WakeHandle
Auto Trait Implementations§
impl Freeze for WakeHandle
impl RefUnwindSafe for WakeHandle
impl Send for WakeHandle
impl Sync for WakeHandle
impl Unpin for WakeHandle
impl UnsafeUnpin for WakeHandle
impl UnwindSafe for WakeHandle
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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> 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>, which can then be
downcast into Box<dyn 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>, which 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> DowncastSend for T
impl<T> DowncastSend for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§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