wasm_bindgen::convertTrait OptionIntoWasmAbi
Source pub trait OptionIntoWasmAbi: IntoWasmAbi {
// Required method
fn none() -> Self::Abi;
}
Expand description
Indicates that this type can be passed to JS as Option<Self>
.
This trait is used when implementing IntoWasmAbi for Option<T>
.
§⚠️ Unstable
This is part of the internal convert
module, no
stability guarantees are provided. Use at your own risk. See its
documentation for more details.
Returns an ABI instance indicating “none”, which JS will interpret as
the None
branch of this option.
It should be guaranteed that the IntoWasmAbi
can never produce the ABI
value returned here.
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.