From 382ad9d15c57cfdd51974db5e85f53e50ba51107 Mon Sep 17 00:00:00 2001 From: Dennis Kobert Date: Thu, 30 Jul 2026 10:28:50 +0000 Subject: [PATCH] Add missing send / sync impls and make rasterize node async --- node-graph/libraries/core-types/src/registry.rs | 8 ++++++++ node-graph/nodes/gstd/src/platform_application_io.rs | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/node-graph/libraries/core-types/src/registry.rs b/node-graph/libraries/core-types/src/registry.rs index 91602d2710..8a320e5e45 100644 --- a/node-graph/libraries/core-types/src/registry.rs +++ b/node-graph/libraries/core-types/src/registry.rs @@ -180,6 +180,14 @@ impl std::fmt::Debug for EdgeHandle { } } +// SAFETY: wasm is single threaded, so the marker-free payload never actually crosses a thread; +// mirrors the old NodeContainer assertion that let the executor live in a sync static. +#[cfg(target_family = "wasm")] +unsafe impl Send for EdgeHandle {} +// SAFETY: as in Send. +#[cfg(target_family = "wasm")] +unsafe impl Sync for EdgeHandle {} + impl EdgeHandle { pub fn new(node: std::sync::Arc>) -> Self { Self::new_erased(node, edge_type::()) diff --git a/node-graph/nodes/gstd/src/platform_application_io.rs b/node-graph/nodes/gstd/src/platform_application_io.rs index 1b9b485adb..0b2ffd66a2 100644 --- a/node-graph/nodes/gstd/src/platform_application_io.rs +++ b/node-graph/nodes/gstd/src/platform_application_io.rs @@ -194,7 +194,7 @@ fn create_canvas(_: impl Ctx) -> CanvasHandle { /// Renders a view of the input graphic within an area defined by the *Footprint*. #[cfg(target_family = "wasm")] #[node_macro::node(category(""))] -fn rasterize( +async fn rasterize( _: impl Ctx, #[implementations( List,