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.

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.

Implementations on Foreign Types§

source§

impl RefFromWasmAbi for [f32]

§

type Abi = WasmSlice

§

type Anchor = Box<[f32], Global>

source§

unsafe fn ref_from_abi(js: WasmSlice) -> Box<[f32]>

source§

impl RefFromWasmAbi for [u16]

§

type Abi = WasmSlice

§

type Anchor = Box<[u16], Global>

source§

unsafe fn ref_from_abi(js: WasmSlice) -> Box<[u16]>

source§

impl RefFromWasmAbi for [i64]

§

type Abi = WasmSlice

§

type Anchor = Box<[i64], Global>

source§

unsafe fn ref_from_abi(js: WasmSlice) -> Box<[i64]>

source§

impl RefFromWasmAbi for [isize]

source§

impl RefFromWasmAbi for [u32]

§

type Abi = WasmSlice

§

type Anchor = Box<[u32], Global>

source§

unsafe fn ref_from_abi(js: WasmSlice) -> Box<[u32]>

source§

impl RefFromWasmAbi for [i16]

§

type Abi = WasmSlice

§

type Anchor = Box<[i16], Global>

source§

unsafe fn ref_from_abi(js: WasmSlice) -> Box<[i16]>

source§

impl RefFromWasmAbi for [f64]

§

type Abi = WasmSlice

§

type Anchor = Box<[f64], Global>

source§

unsafe fn ref_from_abi(js: WasmSlice) -> Box<[f64]>

source§

impl RefFromWasmAbi for [usize]

source§

impl RefFromWasmAbi for str

§

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

§

type Anchor = Box<str, Global>

source§

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

source§

impl RefFromWasmAbi for [u64]

§

type Abi = WasmSlice

§

type Anchor = Box<[u64], Global>

source§

unsafe fn ref_from_abi(js: WasmSlice) -> Box<[u64]>

source§

impl RefFromWasmAbi for [u8]

§

type Abi = WasmSlice

§

type Anchor = Box<[u8], Global>

source§

unsafe fn ref_from_abi(js: WasmSlice) -> Box<[u8]>

source§

impl RefFromWasmAbi for [i8]

§

type Abi = WasmSlice

§

type Anchor = Box<[i8], Global>

source§

unsafe fn ref_from_abi(js: WasmSlice) -> Box<[i8]>

source§

impl RefFromWasmAbi for [i32]

§

type Abi = WasmSlice

§

type Anchor = Box<[i32], Global>

source§

unsafe fn ref_from_abi(js: WasmSlice) -> Box<[i32]>

Implementors§