pub enum WasmValue {
    I32(i32),
    I64(i64),
    F32(f32),
    F64(f64),
    RefExtern(u32),
    RefFunc(u32),
    RefNull(ValType),
}
Expand description

Variants§

§

I32(i32)

A 32-bit integer.

§

I64(i64)

A 64-bit integer.

§

F32(f32)

A 32-bit float.

§

F64(f64)

A 64-bit float.

§

RefExtern(u32)

§

RefFunc(u32)

§

RefNull(ValType)

Implementations§

source§

impl WasmValue

source

pub fn const_instr(&self) -> ConstInstruction

source

pub fn default_for(ty: ValType) -> WasmValue

Get the default value for a given type.

source

pub fn eq_loose(&self, other: &WasmValue) -> bool

source§

impl WasmValue

source

pub fn val_type(&self) -> ValType

Get the type of a WasmValue

Trait Implementations§

source§

impl Clone for WasmValue

source§

fn clone(&self) -> WasmValue

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for WasmValue

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl From<f32> for WasmValue

source§

fn from(i: f32) -> WasmValue

Converts to this type from the input type.
source§

impl From<f64> for WasmValue

source§

fn from(i: f64) -> WasmValue

Converts to this type from the input type.
source§

impl From<i32> for WasmValue

source§

fn from(i: i32) -> WasmValue

Converts to this type from the input type.
source§

impl From<i64> for WasmValue

source§

fn from(i: i64) -> WasmValue

Converts to this type from the input type.
source§

impl Copy for WasmValue

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> ArchivePointee for T

§

type ArchivedMetadata = ()

The archived version of the pointer metadata for this type.
§

fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata ) -> <T as Pointee>::Metadata

Converts some archived metadata to the pointer metadata for itself.
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<F, W, T, D> Deserialize<With<T, W>, D> for F
where W: DeserializeWith<F, T, D>, D: Fallible + ?Sized, F: ?Sized,

§

fn deserialize( &self, deserializer: &mut D ) -> Result<With<T, W>, <D as Fallible>::Error>

Deserializes using the given deserializer
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> LayoutRaw for T

§

fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>

Gets the layout of the type.
§

impl<T> Pointee for T

§

type Metadata = ()

The type for metadata in pointers and references to Self.
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.