[][src]Trait wasm_bindgen::convert::RefFromWasmAbi

pub trait RefFromWasmAbi: WasmDescribe {
    type Abi: WasmAbi;
    type Anchor: Deref<Target = Self>;
    unsafe fn ref_from_abi(js: Self::Abi) -> Self::Anchor;
}

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.

Associated Types

type Abi: WasmAbi

The wasm ABI type references to Self are recovered from.

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.

Loading content...

Required methods

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

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

Safety

Same as FromWasmAbi::from_abi.

Loading content...

Implementations on Foreign Types

impl RefFromWasmAbi for [u8][src]

type Abi = WasmSlice

type Anchor = Box<[u8]>

impl RefFromWasmAbi for [i8][src]

type Abi = WasmSlice

type Anchor = Box<[i8]>

impl RefFromWasmAbi for [u16][src]

type Abi = WasmSlice

type Anchor = Box<[u16]>

impl RefFromWasmAbi for [i16][src]

type Abi = WasmSlice

type Anchor = Box<[i16]>

impl RefFromWasmAbi for [u32][src]

type Abi = WasmSlice

type Anchor = Box<[u32]>

impl RefFromWasmAbi for [i32][src]

type Abi = WasmSlice

type Anchor = Box<[i32]>

impl RefFromWasmAbi for [u64][src]

type Abi = WasmSlice

type Anchor = Box<[u64]>

impl RefFromWasmAbi for [i64][src]

type Abi = WasmSlice

type Anchor = Box<[i64]>

impl RefFromWasmAbi for [usize][src]

type Abi = WasmSlice

type Anchor = Box<[usize]>

impl RefFromWasmAbi for [isize][src]

type Abi = WasmSlice

type Anchor = Box<[isize]>

impl RefFromWasmAbi for [f32][src]

type Abi = WasmSlice

type Anchor = Box<[f32]>

impl RefFromWasmAbi for [f64][src]

type Abi = WasmSlice

type Anchor = Box<[f64]>

impl RefFromWasmAbi for str[src]

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

type Anchor = Box<str>

Loading content...

Implementors

impl RefFromWasmAbi for JsValue[src]

type Abi = u32

type Anchor = ManuallyDrop<JsValue>

Loading content...