Add missing send / sync impls and make rasterize node async

This commit is contained in:
Dennis Kobert
2026-07-30 10:28:50 +00:00
parent b70b28bbe3
commit 382ad9d15c
2 changed files with 9 additions and 1 deletions
@@ -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 { impl EdgeHandle {
pub fn new<T: 'static>(node: std::sync::Arc<ErasedGNode<T>>) -> Self { pub fn new<T: 'static>(node: std::sync::Arc<ErasedGNode<T>>) -> Self {
Self::new_erased(node, edge_type::<T>()) Self::new_erased(node, edge_type::<T>())
@@ -194,7 +194,7 @@ fn create_canvas(_: impl Ctx) -> CanvasHandle {
/// Renders a view of the input graphic within an area defined by the *Footprint*. /// Renders a view of the input graphic within an area defined by the *Footprint*.
#[cfg(target_family = "wasm")] #[cfg(target_family = "wasm")]
#[node_macro::node(category(""))] #[node_macro::node(category(""))]
fn rasterize<T: WasmNotSend + Clone>( async fn rasterize<T: WasmNotSend + Clone>(
_: impl Ctx, _: impl Ctx,
#[implementations( #[implementations(
List<Vector>, List<Vector>,