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

View File

@@ -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<T: 'static>(node: std::sync::Arc<ErasedGNode<T>>) -> Self {
Self::new_erased(node, edge_type::<T>())