mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-06-17 15:01:23 +00:00
Support Option<RustStruct>
in arguments/returns
Add all the necessary support in a few locations and we should be good to go! Closes #1252
This commit is contained in:
@ -248,6 +248,17 @@ impl ToTokens for ast::Struct {
|
||||
(*js).borrow_mut()
|
||||
}
|
||||
}
|
||||
|
||||
impl ::wasm_bindgen::convert::OptionIntoWasmAbi for #name {
|
||||
#[inline]
|
||||
fn none() -> Self::Abi { 0 }
|
||||
}
|
||||
|
||||
impl ::wasm_bindgen::convert::OptionFromWasmAbi for #name {
|
||||
#[inline]
|
||||
fn is_none(abi: &Self::Abi) -> bool { *abi == 0 }
|
||||
}
|
||||
|
||||
})
|
||||
.to_tokens(tokens);
|
||||
|
||||
|
Reference in New Issue
Block a user