wasm_bindgen::convert

Trait OptionFromWasmAbi

Source
pub trait OptionFromWasmAbi: FromWasmAbi {
    // Required method
    fn is_none(abi: &Self::Abi) -> bool;
}
Expand description

Indicates that this type can be received from JS as Option<Self>.

This trait is used when implementing FromWasmAbi 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.

Required Methods§

Source

fn is_none(abi: &Self::Abi) -> bool

Tests whether the argument is a “none” instance. If so it will be deserialized as None, and otherwise it will be passed to FromWasmAbi.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl OptionFromWasmAbi for bool

Source§

impl OptionFromWasmAbi for char

Source§

impl OptionFromWasmAbi for i8

Source§

impl OptionFromWasmAbi for i16

Source§

impl OptionFromWasmAbi for u8

Source§

impl OptionFromWasmAbi for u16

Source§

impl OptionFromWasmAbi for String

Source§

impl<T> OptionFromWasmAbi for Box<[T]>
where Self: FromWasmAbi<Abi = WasmSlice>,

Source§

impl<T> OptionFromWasmAbi for Vec<T>
where Box<[T]>: FromWasmAbi<Abi = WasmSlice>,

Source§

impl<T> OptionFromWasmAbi for NonNull<T>

Implementors§