Replace borrowed scope injections with arcs

This commit is contained in:
Dennis Kobert
2026-07-30 10:58:51 +00:00
parent 382ad9d15c
commit 9bdf4541d0
15 changed files with 68 additions and 68 deletions

View File

@@ -60,6 +60,18 @@ impl std::fmt::Debug for WgpuExecutor {
}
}
/// Owned Arc handle carrying the executor as an ordinary wire value.
#[derive(Clone, Debug)]
pub struct WgpuExecutorHandle(pub std::sync::Arc<WgpuExecutor>);
impl std::ops::Deref for WgpuExecutorHandle {
type Target = WgpuExecutor;
fn deref(&self) -> &WgpuExecutor {
&self.0
}
}
impl<'a, T: ApplicationIo<Executor = WgpuExecutor>> From<&'a EditorApi<T>> for &'a WgpuExecutor {
fn from(editor_api: &'a EditorApi<T>) -> Self {
editor_api.application_io.as_ref().unwrap().gpu_executor().unwrap()