gpui_platform/
executor.rs1use async_task::Runnable;
4use gpui_util::Deferred;
5use scheduler::RunnableMeta;
6
7pub struct ActivityGuard {
9 _release: Deferred<Box<dyn FnOnce() + Send>>,
10}
11
12impl ActivityGuard {
13 pub fn new(release: impl FnOnce() + Send + 'static) -> Self {
15 Self {
16 _release: gpui_util::defer(Box::new(release)),
17 }
18 }
19
20 pub fn noop() -> Self {
22 Self::new(|| {})
23 }
24}
25
26#[doc(hidden)]
29pub type RunnableVariant = Runnable<RunnableMeta>;
30
31#[doc(hidden)]
32pub type TimerResolutionGuard = Deferred<Box<dyn FnOnce() + Send>>;