pub trait FromWasmAbi: WasmDescribe {
    type Abi: WasmAbi;

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

A trait for anything that can be recovered by-value from the wasm ABI boundary, eg a Rust u8 can be recovered from the wasm ABI u32 type.

This is the by-value variant of the opposite operation as IntoWasmAbi.

Required Associated Types§

source

type Abi: WasmAbi

The wasm ABI type that this converts from when coming back out from the ABI boundary.

Required Methods§

source

unsafe fn from_abi(js: Self::Abi) -> Self

Recover a Self from Self::Abi.

Safety

This is only safe to call when – and implementations may assume that – the supplied Self::Abi was previously generated by a call to <Self as IntoWasmAbi>::into_abi() or the moral equivalent in JS.

Implementations on Foreign Types§

source§

impl FromWasmAbi for i32

§

type Abi = i32

source§

unsafe fn from_abi(js: i32) -> Self

source§

impl FromWasmAbi for Option<i32>

§

type Abi = WasmOption<i32>

source§

unsafe fn from_abi(js: Self::Abi) -> Self

source§

impl FromWasmAbi for isize

§

type Abi = i32

source§

unsafe fn from_abi(js: i32) -> Self

source§

impl FromWasmAbi for Option<isize>

§

type Abi = WasmOption<i32>

source§

unsafe fn from_abi(js: Self::Abi) -> Self

source§

impl FromWasmAbi for u32

§

type Abi = u32

source§

unsafe fn from_abi(js: u32) -> Self

source§

impl FromWasmAbi for Option<u32>

§

type Abi = WasmOption<u32>

source§

unsafe fn from_abi(js: Self::Abi) -> Self

source§

impl FromWasmAbi for usize

§

type Abi = u32

source§

unsafe fn from_abi(js: u32) -> Self

source§

impl FromWasmAbi for Option<usize>

§

type Abi = WasmOption<u32>

source§

unsafe fn from_abi(js: Self::Abi) -> Self

source§

impl FromWasmAbi for i64

§

type Abi = i64

source§

unsafe fn from_abi(js: i64) -> Self

source§

impl FromWasmAbi for Option<i64>

§

type Abi = WasmOption<i64>

source§

unsafe fn from_abi(js: Self::Abi) -> Self

source§

impl FromWasmAbi for u64

§

type Abi = u64

source§

unsafe fn from_abi(js: u64) -> Self

source§

impl FromWasmAbi for Option<u64>

§

type Abi = WasmOption<u64>

source§

unsafe fn from_abi(js: Self::Abi) -> Self

source§

impl FromWasmAbi for f32

§

type Abi = f32

source§

unsafe fn from_abi(js: f32) -> Self

source§

impl FromWasmAbi for Option<f32>

§

type Abi = WasmOption<f32>

source§

unsafe fn from_abi(js: Self::Abi) -> Self

source§

impl FromWasmAbi for f64

§

type Abi = f64

source§

unsafe fn from_abi(js: f64) -> Self

source§

impl FromWasmAbi for Option<f64>

§

type Abi = WasmOption<f64>

source§

unsafe fn from_abi(js: Self::Abi) -> Self

source§

impl FromWasmAbi for i8

§

type Abi = u32

source§

unsafe fn from_abi(js: u32) -> Self

source§

impl FromWasmAbi for u8

§

type Abi = u32

source§

unsafe fn from_abi(js: u32) -> Self

source§

impl FromWasmAbi for i16

§

type Abi = u32

source§

unsafe fn from_abi(js: u32) -> Self

source§

impl FromWasmAbi for u16

§

type Abi = u32

source§

unsafe fn from_abi(js: u32) -> Self

source§

impl FromWasmAbi for bool

§

type Abi = u32

source§

unsafe fn from_abi(js: u32) -> bool

source§

impl FromWasmAbi for char

§

type Abi = u32

source§

unsafe fn from_abi(js: u32) -> char

source§

impl<T> FromWasmAbi for *const T

§

type Abi = u32

source§

unsafe fn from_abi(js: u32) -> *const T

source§

impl<T> FromWasmAbi for *mut T

§

type Abi = u32

source§

unsafe fn from_abi(js: u32) -> *mut T

source§

impl<T: OptionFromWasmAbi> FromWasmAbi for Option<T>

§

type Abi = <T as FromWasmAbi>::Abi

source§

unsafe fn from_abi(js: T::Abi) -> Self

source§

impl FromWasmAbi for Box<[u8]>

§

type Abi = WasmSlice

source§

unsafe fn from_abi(js: WasmSlice) -> Self

source§

impl FromWasmAbi for Box<[i8]>

§

type Abi = WasmSlice

source§

unsafe fn from_abi(js: WasmSlice) -> Self

source§

impl FromWasmAbi for Box<[u16]>

§

type Abi = WasmSlice

source§

unsafe fn from_abi(js: WasmSlice) -> Self

source§

impl FromWasmAbi for Box<[i16]>

§

type Abi = WasmSlice

source§

unsafe fn from_abi(js: WasmSlice) -> Self

source§

impl FromWasmAbi for Box<[u32]>

§

type Abi = WasmSlice

source§

unsafe fn from_abi(js: WasmSlice) -> Self

source§

impl FromWasmAbi for Box<[i32]>

§

type Abi = WasmSlice

source§

unsafe fn from_abi(js: WasmSlice) -> Self

source§

impl FromWasmAbi for Box<[u64]>

§

type Abi = WasmSlice

source§

unsafe fn from_abi(js: WasmSlice) -> Self

source§

impl FromWasmAbi for Box<[i64]>

§

type Abi = WasmSlice

source§

unsafe fn from_abi(js: WasmSlice) -> Self

source§

impl FromWasmAbi for Box<[usize]>

§

type Abi = WasmSlice

source§

unsafe fn from_abi(js: WasmSlice) -> Self

source§

impl FromWasmAbi for Box<[isize]>

§

type Abi = WasmSlice

source§

unsafe fn from_abi(js: WasmSlice) -> Self

source§

impl FromWasmAbi for Box<[f32]>

§

type Abi = WasmSlice

source§

unsafe fn from_abi(js: WasmSlice) -> Self

source§

impl FromWasmAbi for Box<[f64]>

§

type Abi = WasmSlice

source§

unsafe fn from_abi(js: WasmSlice) -> Self

source§

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

§

type Abi = <Box<[T], Global> as FromWasmAbi>::Abi

source§

unsafe fn from_abi(js: Self::Abi) -> Self

source§

impl FromWasmAbi for String

§

type Abi = <Vec<u8, Global> as FromWasmAbi>::Abi

source§

unsafe fn from_abi(js: Self::Abi) -> Self

source§

impl FromWasmAbi for Box<[JsValue]>

§

type Abi = WasmSlice

source§

unsafe fn from_abi(js: WasmSlice) -> Self

source§

impl<T> FromWasmAbi for Box<[T]>where
T: JsObject,

§

type Abi = WasmSlice

source§

unsafe fn from_abi(js: WasmSlice) -> Self

Implementors§