Skip to main content

Module maybe

Module maybe 

Source
Expand description

Target-conditional Send/Sync bounds (Send native, vacuous on wasm). Target-conditional Send/Sync bounds: real on native, vacuous on wasm32.

The pipeline runs as one logical task on every target. On native that task should still be Send so a work-stealing executor (e.g. multi-threaded tokio) can spawn and migrate it like any other task. On wasm32 there is only one thread and JS handles (JsValue) are !Send, so the same bounds must vanish. These aliases express “Send where it exists” once, so the rest of the codebase is written a single time.

Traits§

MaybeSend
Send on native targets; no requirement on wasm32.
MaybeSendSync
Send + Sync on native targets; no requirement on wasm32.