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.

Object Safety§

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§