NativeWasmType

Trait NativeWasmType 

Source
pub unsafe trait NativeWasmType:
    Copy
    + Into<Value>
    + Sized {
    const TYPE: Type;

    // Required methods
    fn from_binary(bits: u64) -> Self;
    fn to_binary(self) -> u64;
}
Expand description

Represents a native wasm type.

Required Associated Constants§

Source

const TYPE: Type

Type for this NativeWasmType.

Required Methods§

Source

fn from_binary(bits: u64) -> Self

Convert from u64 bites to self.

Source

fn to_binary(self) -> u64

Convert self to u64 binary representation.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl NativeWasmType for f32

Source§

const TYPE: Type = Type::F32

Source§

fn from_binary(bits: u64) -> f32

Source§

fn to_binary(self) -> u64

Source§

impl NativeWasmType for f64

Source§

const TYPE: Type = Type::F64

Source§

fn from_binary(bits: u64) -> f64

Source§

fn to_binary(self) -> u64

Source§

impl NativeWasmType for i32

Source§

const TYPE: Type = Type::I32

Source§

fn from_binary(bits: u64) -> i32

Source§

fn to_binary(self) -> u64

Source§

impl NativeWasmType for i64

Source§

const TYPE: Type = Type::I64

Source§

fn from_binary(bits: u64) -> i64

Source§

fn to_binary(self) -> u64

Implementors§