wasm_bindgen::convert

Trait RefFromWasmAbi

Source
pub trait RefFromWasmAbi: WasmDescribe {
    type Abi: WasmAbi;
    type Anchor: Deref<Target = Self>;

    // Required method
    unsafe fn ref_from_abi(js: Self::Abi) -> Self::Anchor;
}
Expand description

A trait for anything that can be recovered as some sort of shared reference from the Wasm ABI boundary.

This is the shared reference variant of the opposite operation as IntoWasmAbi.

§⚠️ 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 Associated Types§

Source

type Abi: WasmAbi

The Wasm ABI type references to Self are recovered from.

Source

type Anchor: Deref<Target = Self>

The type that holds the reference to Self for the duration of the invocation of the function that has an &Self parameter. This is required to ensure that the lifetimes don’t persist beyond one function call, and so that they remain anonymous.

Required Methods§

Source

unsafe fn ref_from_abi(js: Self::Abi) -> Self::Anchor

Recover a Self::Anchor from Self::Abi.

§Safety

Same as FromWasmAbi::from_abi.

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 RefFromWasmAbi for str

Source§

type Abi = <[u8] as RefFromWasmAbi>::Abi

Source§

type Anchor = Box<str>

Source§

unsafe fn ref_from_abi(js: Self::Abi) -> Self::Anchor

Source§

impl RefFromWasmAbi for [f32]

Source§

impl RefFromWasmAbi for [f64]

Source§

impl RefFromWasmAbi for [i8]

Source§

impl RefFromWasmAbi for [i16]

Source§

impl RefFromWasmAbi for [i32]

Source§

impl RefFromWasmAbi for [i64]

Source§

impl RefFromWasmAbi for [isize]

Source§

impl RefFromWasmAbi for [u8]

Source§

impl RefFromWasmAbi for [u16]

Source§

impl RefFromWasmAbi for [u32]

Source§

impl RefFromWasmAbi for [u64]

Source§

impl RefFromWasmAbi for [usize]

Implementors§