Refactor ruin_app, add some README files, minor usability in reactivity
This commit is contained in:
@@ -54,6 +54,12 @@ pub struct TimeoutHandle {
|
||||
_local: Rc<()>,
|
||||
}
|
||||
|
||||
impl TimeoutHandle {
|
||||
pub fn clear(&self) {
|
||||
clear_timeout(self);
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone)]
|
||||
/// Handle returned by [`set_interval`].
|
||||
pub struct IntervalHandle {
|
||||
@@ -62,6 +68,12 @@ pub struct IntervalHandle {
|
||||
_local: Rc<()>,
|
||||
}
|
||||
|
||||
impl IntervalHandle {
|
||||
pub fn clear(&self) {
|
||||
clear_interval(self);
|
||||
}
|
||||
}
|
||||
|
||||
/// Handle returned by [`queue_future`].
|
||||
///
|
||||
/// Awaiting a join handle yields the output of the queued future.
|
||||
@@ -72,9 +84,10 @@ pub struct JoinHandle<T> {
|
||||
/// Future returned by [`yield_now`].
|
||||
///
|
||||
/// Awaiting this future will immediately yield control back to the runtime scheduler, allowing other queued microtasks
|
||||
/// to run before the current task continues executing. Note that continuation of futures runs as a microtask, so this
|
||||
/// to run before the current task continues executing. Note that continuations of futures run as microtasks, so this
|
||||
/// can only yield to other microtasks and not to macrotasks (driver events such as file or network I/O, timers, or
|
||||
/// channel messages).
|
||||
/// channel messages). To yield to macrotasks, you must allow the flow of execution to return to the runtime event loop
|
||||
/// and flush the full microtask queue, for example by awaiting a timer.
|
||||
pub struct YieldNow {
|
||||
yielded: bool,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user