#[repr(transparent)]
pub struct UntypedValue { /* private fields */ }
Expand description

An untyped Value.

Provides a dense and simple interface to all functional Wasm operations.

Implementations§

source§

impl UntypedValue

source

pub fn to_bits(self) -> u64

Returns the underlying bits of the UntypedValue.

source

pub fn with_type(self, value_type: ValueType) -> Value

Converts the UntypedValue into a Value.

source§

impl UntypedValue

source

pub fn i32_add(self, rhs: Self) -> Self

Execute i32.add Wasm operation.

source

pub fn i64_add(self, rhs: Self) -> Self

Execute i64.add Wasm operation.

source

pub fn i32_sub(self, rhs: Self) -> Self

Execute i32.sub Wasm operation.

source

pub fn i64_sub(self, rhs: Self) -> Self

Execute i64.sub Wasm operation.

source

pub fn i32_mul(self, rhs: Self) -> Self

Execute i32.mul Wasm operation.

source

pub fn i64_mul(self, rhs: Self) -> Self

Execute i64.mul Wasm operation.

source

pub fn i32_div_s(self, rhs: Self) -> Result<Self, TrapCode>

Execute i32.div_s Wasm operation.

source

pub fn i64_div_s(self, rhs: Self) -> Result<Self, TrapCode>

Execute i64.div_s Wasm operation.

source

pub fn i32_div_u(self, rhs: Self) -> Result<Self, TrapCode>

Execute i32.div_u Wasm operation.

source

pub fn i64_div_u(self, rhs: Self) -> Result<Self, TrapCode>

Execute i64.div_u Wasm operation.

source

pub fn i32_rem_s(self, rhs: Self) -> Result<Self, TrapCode>

Execute i32.rem_s Wasm operation.

source

pub fn i64_rem_s(self, rhs: Self) -> Result<Self, TrapCode>

Execute i64.rem_s Wasm operation.

source

pub fn i32_rem_u(self, rhs: Self) -> Result<Self, TrapCode>

Execute i32.rem_u Wasm operation.

source

pub fn i64_rem_u(self, rhs: Self) -> Result<Self, TrapCode>

Execute i64.rem_u Wasm operation.

source

pub fn i32_and(self, rhs: Self) -> Self

Execute i32.and Wasm operation.

source

pub fn i64_and(self, rhs: Self) -> Self

Execute i64.and Wasm operation.

source

pub fn i32_or(self, rhs: Self) -> Self

Execute i32.or Wasm operation.

source

pub fn i64_or(self, rhs: Self) -> Self

Execute i64.or Wasm operation.

source

pub fn i32_xor(self, rhs: Self) -> Self

Execute i32.xor Wasm operation.

source

pub fn i64_xor(self, rhs: Self) -> Self

Execute i64.xor Wasm operation.

source

pub fn i32_shl(self, rhs: Self) -> Self

Execute i32.shl Wasm operation.

source

pub fn i64_shl(self, rhs: Self) -> Self

Execute i64.shl Wasm operation.

source

pub fn i32_shr_s(self, rhs: Self) -> Self

Execute i32.shr_s Wasm operation.

source

pub fn i64_shr_s(self, rhs: Self) -> Self

Execute i64.shr_s Wasm operation.

source

pub fn i32_shr_u(self, rhs: Self) -> Self

Execute i32.shr_u Wasm operation.

source

pub fn i64_shr_u(self, rhs: Self) -> Self

Execute i64.shr_u Wasm operation.

source

pub fn i32_clz(self) -> Self

Execute i32.clz Wasm operation.

source

pub fn i64_clz(self) -> Self

Execute i64.clz Wasm operation.

source

pub fn i32_ctz(self) -> Self

Execute i32.ctz Wasm operation.

source

pub fn i64_ctz(self) -> Self

Execute i64.ctz Wasm operation.

source

pub fn i32_popcnt(self) -> Self

Execute i32.popcnt Wasm operation.

source

pub fn i64_popcnt(self) -> Self

Execute i64.popcnt Wasm operation.

source

pub fn i32_rotl(self, rhs: Self) -> Self

Execute i32.rotl Wasm operation.

source

pub fn i64_rotl(self, rhs: Self) -> Self

Execute i64.rotl Wasm operation.

source

pub fn i32_rotr(self, rhs: Self) -> Self

Execute i32.rotr Wasm operation.

source

pub fn i64_rotr(self, rhs: Self) -> Self

Execute i64.rotr Wasm operation.

source

pub fn i32_eqz(self) -> Self

Execute i32.eqz Wasm operation.

source

pub fn i64_eqz(self) -> Self

Execute i64.eqz Wasm operation.

source

pub fn i32_eq(self, rhs: Self) -> Self

Execute i32.eq Wasm operation.

source

pub fn i64_eq(self, rhs: Self) -> Self

Execute i64.eq Wasm operation.

source

pub fn f32_eq(self, rhs: Self) -> Self

Execute f32.eq Wasm operation.

source

pub fn f64_eq(self, rhs: Self) -> Self

Execute f64.eq Wasm operation.

source

pub fn i32_ne(self, rhs: Self) -> Self

Execute i32.ne Wasm operation.

source

pub fn i64_ne(self, rhs: Self) -> Self

Execute i64.ne Wasm operation.

source

pub fn f32_ne(self, rhs: Self) -> Self

Execute f32.ne Wasm operation.

source

pub fn f64_ne(self, rhs: Self) -> Self

Execute f64.ne Wasm operation.

source

pub fn i32_lt_s(self, rhs: Self) -> Self

Execute i32.lt_s Wasm operation.

source

pub fn i64_lt_s(self, rhs: Self) -> Self

Execute i64.lt_s Wasm operation.

source

pub fn i32_lt_u(self, rhs: Self) -> Self

Execute i32.lt_u Wasm operation.

source

pub fn i64_lt_u(self, rhs: Self) -> Self

Execute i64.lt_u Wasm operation.

source

pub fn f32_lt(self, rhs: Self) -> Self

Execute f32.lt Wasm operation.

source

pub fn f64_lt(self, rhs: Self) -> Self

Execute f64.lt Wasm operation.

source

pub fn i32_le_s(self, rhs: Self) -> Self

Execute i32.le_s Wasm operation.

source

pub fn i64_le_s(self, rhs: Self) -> Self

Execute i64.le_s Wasm operation.

source

pub fn i32_le_u(self, rhs: Self) -> Self

Execute i32.le_u Wasm operation.

source

pub fn i64_le_u(self, rhs: Self) -> Self

Execute i64.le_u Wasm operation.

source

pub fn f32_le(self, rhs: Self) -> Self

Execute f32.le Wasm operation.

source

pub fn f64_le(self, rhs: Self) -> Self

Execute f64.le Wasm operation.

source

pub fn i32_gt_s(self, rhs: Self) -> Self

Execute i32.gt_s Wasm operation.

source

pub fn i64_gt_s(self, rhs: Self) -> Self

Execute i64.gt_s Wasm operation.

source

pub fn i32_gt_u(self, rhs: Self) -> Self

Execute i32.gt_u Wasm operation.

source

pub fn i64_gt_u(self, rhs: Self) -> Self

Execute i64.gt_u Wasm operation.

source

pub fn f32_gt(self, rhs: Self) -> Self

Execute f32.gt Wasm operation.

source

pub fn f64_gt(self, rhs: Self) -> Self

Execute f64.gt Wasm operation.

source

pub fn i32_ge_s(self, rhs: Self) -> Self

Execute i32.ge_s Wasm operation.

source

pub fn i64_ge_s(self, rhs: Self) -> Self

Execute i64.ge_s Wasm operation.

source

pub fn i32_ge_u(self, rhs: Self) -> Self

Execute i32.ge_u Wasm operation.

source

pub fn i64_ge_u(self, rhs: Self) -> Self

Execute i64.ge_u Wasm operation.

source

pub fn f32_ge(self, rhs: Self) -> Self

Execute f32.ge Wasm operation.

source

pub fn f64_ge(self, rhs: Self) -> Self

Execute f64.ge Wasm operation.

source

pub fn f32_abs(self) -> Self

Execute f32.abs Wasm operation.

source

pub fn f32_neg(self) -> Self

Execute f32.neg Wasm operation.

source

pub fn f32_ceil(self) -> Self

Execute f32.ceil Wasm operation.

source

pub fn f32_floor(self) -> Self

Execute f32.floor Wasm operation.

source

pub fn f32_trunc(self) -> Self

Execute f32.trunc Wasm operation.

source

pub fn f32_nearest(self) -> Self

Execute f32.nearest Wasm operation.

source

pub fn f32_sqrt(self) -> Self

Execute f32.sqrt Wasm operation.

source

pub fn f32_min(self, other: Self) -> Self

Execute f32.min Wasm operation.

source

pub fn f32_max(self, other: Self) -> Self

Execute f32.max Wasm operation.

source

pub fn f32_copysign(self, other: Self) -> Self

Execute f32.copysign Wasm operation.

source

pub fn f64_abs(self) -> Self

Execute f64.abs Wasm operation.

source

pub fn f64_neg(self) -> Self

Execute f64.neg Wasm operation.

source

pub fn f64_ceil(self) -> Self

Execute f64.ceil Wasm operation.

source

pub fn f64_floor(self) -> Self

Execute f64.floor Wasm operation.

source

pub fn f64_trunc(self) -> Self

Execute f64.trunc Wasm operation.

source

pub fn f64_nearest(self) -> Self

Execute f64.nearest Wasm operation.

source

pub fn f64_sqrt(self) -> Self

Execute f64.sqrt Wasm operation.

source

pub fn f32_add(self, rhs: Self) -> Self

Execute f32.add Wasm operation.

source

pub fn f64_add(self, rhs: Self) -> Self

Execute f64.add Wasm operation.

source

pub fn f32_sub(self, rhs: Self) -> Self

Execute f32.sub Wasm operation.

source

pub fn f64_sub(self, rhs: Self) -> Self

Execute f64.sub Wasm operation.

source

pub fn f32_mul(self, rhs: Self) -> Self

Execute f32.mul Wasm operation.

source

pub fn f64_mul(self, rhs: Self) -> Self

Execute f64.mul Wasm operation.

source

pub fn f32_div(self, rhs: Self) -> Result<Self, TrapCode>

Execute f32.div Wasm operation.

source

pub fn f64_div(self, rhs: Self) -> Result<Self, TrapCode>

Execute f64.div Wasm operation.

source

pub fn f64_min(self, other: Self) -> Self

Execute f64.min Wasm operation.

source

pub fn f64_max(self, other: Self) -> Self

Execute f64.max Wasm operation.

source

pub fn f64_copysign(self, other: Self) -> Self

Execute f64.copysign Wasm operation.

source

pub fn i32_wrap_i64(self) -> Self

Execute i32.wrap_i64 Wasm operation.

source

pub fn i32_trunc_f32_s(self) -> Result<Self, TrapCode>

Execute i32.trunc_f32_s Wasm operation.

source

pub fn i32_trunc_f32_u(self) -> Result<Self, TrapCode>

Execute i32.trunc_f32_u Wasm operation.

source

pub fn i32_trunc_f64_s(self) -> Result<Self, TrapCode>

Execute i32.trunc_f64_s Wasm operation.

source

pub fn i32_trunc_f64_u(self) -> Result<Self, TrapCode>

Execute i32.trunc_f64_u Wasm operation.

source

pub fn i64_extend_i32_s(self) -> Self

Execute i64.extend_i32_s Wasm operation.

source

pub fn i64_extend_i32_u(self) -> Self

Execute i64.extend_i32_u Wasm operation.

source

pub fn i64_trunc_f32_s(self) -> Result<Self, TrapCode>

Execute i64.trunc_f32_s Wasm operation.

source

pub fn i64_trunc_f32_u(self) -> Result<Self, TrapCode>

Execute i64.trunc_f32_u Wasm operation.

source

pub fn i64_trunc_f64_s(self) -> Result<Self, TrapCode>

Execute i64.trunc_f64_s Wasm operation.

source

pub fn i64_trunc_f64_u(self) -> Result<Self, TrapCode>

Execute i64.trunc_f64_u Wasm operation.

source

pub fn f32_convert_i32_s(self) -> Self

Execute f32.convert_i32_s Wasm operation.

source

pub fn f32_convert_i32_u(self) -> Self

Execute f32.convert_i32_u Wasm operation.

source

pub fn f32_convert_i64_s(self) -> Self

Execute f32.convert_i64_s Wasm operation.

source

pub fn f32_convert_i64_u(self) -> Self

Execute f32.convert_i64_u Wasm operation.

source

pub fn f32_demote_f64(self) -> Self

Execute f32.demote_f64 Wasm operation.

source

pub fn f64_convert_i32_s(self) -> Self

Execute f64.convert_i32_s Wasm operation.

source

pub fn f64_convert_i32_u(self) -> Self

Execute f64.convert_i32_u Wasm operation.

source

pub fn f64_convert_i64_s(self) -> Self

Execute f64.convert_i64_s Wasm operation.

source

pub fn f64_convert_i64_u(self) -> Self

Execute f64.convert_i64_u Wasm operation.

source

pub fn f64_promote_f32(self) -> Self

Execute f64.promote_f32 Wasm operation.

source

pub fn i32_extend8_s(self) -> Self

Execute i32.extend8_s Wasm operation.

source

pub fn i32_extend16_s(self) -> Self

Execute i32.extend16_s Wasm operation.

source

pub fn i64_extend8_s(self) -> Self

Execute i64.extend8_s Wasm operation.

source

pub fn i64_extend16_s(self) -> Self

Execute i64.extend16_s Wasm operation.

source

pub fn i64_extend32_s(self) -> Self

Execute i64.extend32_s Wasm operation.

source

pub fn i32_trunc_sat_f32_s(self) -> Self

Execute i32.trunc_sat_f32_s Wasm operation.

source

pub fn i32_trunc_sat_f32_u(self) -> Self

Execute i32.trunc_sat_f32_u Wasm operation.

source

pub fn i32_trunc_sat_f64_s(self) -> Self

Execute i32.trunc_sat_f64_s Wasm operation.

source

pub fn i32_trunc_sat_f64_u(self) -> Self

Execute i32.trunc_sat_f64_u Wasm operation.

source

pub fn i64_trunc_sat_f32_s(self) -> Self

Execute i64.trunc_sat_f32_s Wasm operation.

source

pub fn i64_trunc_sat_f32_u(self) -> Self

Execute i64.trunc_sat_f32_u Wasm operation.

source

pub fn i64_trunc_sat_f64_s(self) -> Self

Execute i64.trunc_sat_f64_s Wasm operation.

source

pub fn i64_trunc_sat_f64_u(self) -> Self

Execute i64.trunc_sat_f64_u Wasm operation.

source§

impl UntypedValue

source

pub fn decode_slice<T>(slice: &[Self]) -> Result<T, UntypedError>where T: DecodeUntypedSlice,

Decodes the slice of UntypedValue as a value of type T.

Note

T can either be a single type or a tuple of types depending on the length of the slice.

Errors

If the tuple length of T and the length of slice does not match.

source

pub fn encode_slice<T>(slice: &mut [Self], input: T) -> Result<(), UntypedError>where T: EncodeUntypedSlice,

Encodes the slice of UntypedValue from the given value of type T.

Note

T can either be a single type or a tuple of types depending on the length of the slice.

Errors

If the tuple length of T and the length of slice does not match.

Trait Implementations§

source§

impl Clone for UntypedValue

source§

fn clone(&self) -> UntypedValue

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 UntypedValue

source§

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

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

impl Default for UntypedValue

source§

fn default() -> UntypedValue

Returns the “default value” for a type. Read more
source§

impl From<F32> for UntypedValue

source§

fn from(value: F32) -> Self

Converts to this type from the input type.
source§

impl From<F64> for UntypedValue

source§

fn from(value: F64) -> Self

Converts to this type from the input type.
source§

impl From<UntypedValue> for F32

source§

fn from(untyped: UntypedValue) -> Self

Converts to this type from the input type.
source§

impl From<UntypedValue> for F64

source§

fn from(untyped: UntypedValue) -> Self

Converts to this type from the input type.
source§

impl From<UntypedValue> for bool

source§

fn from(untyped: UntypedValue) -> Self

Converts to this type from the input type.
source§

impl From<UntypedValue> for f32

source§

fn from(untyped: UntypedValue) -> Self

Converts to this type from the input type.
source§

impl From<UntypedValue> for f64

source§

fn from(untyped: UntypedValue) -> Self

Converts to this type from the input type.
source§

impl From<UntypedValue> for i16

source§

fn from(untyped: UntypedValue) -> Self

Converts to this type from the input type.
source§

impl From<UntypedValue> for i32

source§

fn from(untyped: UntypedValue) -> Self

Converts to this type from the input type.
source§

impl From<UntypedValue> for i64

source§

fn from(untyped: UntypedValue) -> Self

Converts to this type from the input type.
source§

impl From<UntypedValue> for i8

source§

fn from(untyped: UntypedValue) -> Self

Converts to this type from the input type.
source§

impl From<UntypedValue> for u16

source§

fn from(untyped: UntypedValue) -> Self

Converts to this type from the input type.
source§

impl From<UntypedValue> for u32

source§

fn from(untyped: UntypedValue) -> Self

Converts to this type from the input type.
source§

impl From<UntypedValue> for u64

source§

fn from(untyped: UntypedValue) -> Self

Converts to this type from the input type.
source§

impl From<UntypedValue> for u8

source§

fn from(untyped: UntypedValue) -> Self

Converts to this type from the input type.
source§

impl From<Value> for UntypedValue

source§

fn from(value: Value) -> Self

Converts to this type from the input type.
source§

impl From<bool> for UntypedValue

source§

fn from(value: bool) -> Self

Converts to this type from the input type.
source§

impl From<f32> for UntypedValue

source§

fn from(value: f32) -> Self

Converts to this type from the input type.
source§

impl From<f64> for UntypedValue

source§

fn from(value: f64) -> Self

Converts to this type from the input type.
source§

impl From<i16> for UntypedValue

source§

fn from(value: i16) -> Self

Converts to this type from the input type.
source§

impl From<i32> for UntypedValue

source§

fn from(value: i32) -> Self

Converts to this type from the input type.
source§

impl From<i64> for UntypedValue

source§

fn from(value: i64) -> Self

Converts to this type from the input type.
source§

impl From<i8> for UntypedValue

source§

fn from(value: i8) -> Self

Converts to this type from the input type.
source§

impl From<u16> for UntypedValue

source§

fn from(value: u16) -> Self

Converts to this type from the input type.
source§

impl From<u32> for UntypedValue

source§

fn from(value: u32) -> Self

Converts to this type from the input type.
source§

impl From<u64> for UntypedValue

source§

fn from(value: u64) -> Self

Converts to this type from the input type.
source§

impl From<u8> for UntypedValue

source§

fn from(value: u8) -> Self

Converts to this type from the input type.
source§

impl Ord for UntypedValue

source§

fn cmp(&self, other: &UntypedValue) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Selfwhere Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Selfwhere Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Selfwhere Self: Sized + PartialOrd<Self>,

Restrict a value to a certain interval. Read more
source§

impl PartialEq<UntypedValue> for UntypedValue

source§

fn eq(&self, other: &UntypedValue) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd<UntypedValue> for UntypedValue

source§

fn partial_cmp(&self, other: &UntypedValue) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl Copy for UntypedValue

source§

impl Eq for UntypedValue

source§

impl StructuralEq for UntypedValue

source§

impl StructuralPartialEq for UntypedValue

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

impl<T1> DecodeUntypedSlice for T1where T1: From<UntypedValue>,

source§

fn decode_untyped_slice(results: &[UntypedValue]) -> Result<T1, UntypedError>

Decodes the slice of UntypedValue as a value of type Self. Read more
source§

impl<T> Downcast for Twhere T: Any,

source§

fn into_any(self: Box<T, Global>) -> Box<dyn Any, Global>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
source§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
source§

impl<T> DowncastSync for Twhere T: Any + Send + Sync,

source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
source§

impl<T1> EncodeUntypedSlice for T1where T1: Into<UntypedValue>,

source§

fn encode_untyped_slice( self, results: &mut [UntypedValue] ) -> Result<(), UntypedError>

Encodes the slice of UntypedValue from the given value of type Self. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere 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.

source§

impl<T> ToOwned for Twhere 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 Twhere 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 Twhere 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.