mirror of
https://github.com/mii443/wasmer.git
synced 2025-12-09 22:28:21 +00:00
Added extra comments on what can be Send/Sync
This commit is contained in:
@@ -45,7 +45,16 @@ pub struct Module {
|
||||
raw_bytes: Option<Bytes>,
|
||||
}
|
||||
|
||||
// Module implements `structuredClone` in js, so it's safe it to make it Send.
|
||||
// https://developer.mozilla.org/en-US/docs/Web/API/structuredClone
|
||||
// ```js
|
||||
// const module = new WebAssembly.Module(new Uint8Array([
|
||||
// 0x00, 0x61, 0x73, 0x6d, 0x01, 0x00, 0x00, 0x00
|
||||
// ]));
|
||||
// structuredClone(module)
|
||||
// ```
|
||||
unsafe impl Send for Module {}
|
||||
unsafe impl Sync for Module {}
|
||||
|
||||
impl Module {
|
||||
pub(crate) fn from_binary(
|
||||
|
||||
Reference in New Issue
Block a user