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.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl FromWasmAbi for Option<f32>

§

type Abi = Option<f32>

source§

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

source§

impl FromWasmAbi for Option<f64>

§

type Abi = Option<f64>

source§

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

source§

impl FromWasmAbi for Option<i32>

§

type Abi = Option<i32>

source§

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

source§

impl FromWasmAbi for Option<i64>

§

type Abi = Option<i64>

source§

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

source§

impl FromWasmAbi for Option<isize>

§

type Abi = Option<i32>

source§

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

source§

impl FromWasmAbi for Option<u32>

§

type Abi = Option<u32>

source§

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

source§

impl FromWasmAbi for Option<u64>

§

type Abi = Option<u64>

source§

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

source§

impl FromWasmAbi for Option<usize>

§

type Abi = Option<u32>

source§

unsafe fn from_abi(js: Self::Abi) -> 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 FromWasmAbi for f32

§

type Abi = f32

source§

unsafe fn from_abi(js: f32) -> Self

source§

impl FromWasmAbi for f64

§

type Abi = f64

source§

unsafe fn from_abi(js: f64) -> Self

source§

impl FromWasmAbi for i8

§

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 i32

§

type Abi = i32

source§

unsafe fn from_abi(js: i32) -> Self

source§

impl FromWasmAbi for i64

§

type Abi = i64

source§

unsafe fn from_abi(js: i64) -> Self

source§

impl FromWasmAbi for isize

§

type Abi = i32

source§

unsafe fn from_abi(js: i32) -> Self

source§

impl FromWasmAbi for u8

§

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 u32

§

type Abi = u32

source§

unsafe fn from_abi(js: u32) -> Self

source§

impl FromWasmAbi for u64

§

type Abi = u64

source§

unsafe fn from_abi(js: u64) -> Self

source§

impl FromWasmAbi for usize

§

type Abi = u32

source§

unsafe fn from_abi(js: u32) -> Self

source§

impl FromWasmAbi for String

§

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

source§

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

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> FromWasmAbi for Vec<T>
where Box<[T]>: FromWasmAbi<Abi = WasmSlice>,

§

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

source§

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

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<T: VectorFromWasmAbi> FromWasmAbi for Box<[T]>

§

type Abi = <T as VectorFromWasmAbi>::Abi

source§

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

Implementors§