Enum wasmi::RuntimeValue
source · Expand description
Runtime representation of a value.
Wasm code manipulate values of the four basic value types: integers and floating-point (IEEE 754-2008) data of 32 or 64 bit width each, respectively.
There is no distinction between signed and unsigned integer types. Instead, integers are interpreted by respective operations as either unsigned or signed in two’s complement representation.
Variants§
I32(i32)
Value of 32-bit signed or unsigned integer.
I64(i64)
Value of 64-bit signed or unsigned integer.
F32(F32)
Value of 32-bit IEEE 754-2008 floating point number.
F64(F64)
Value of 64-bit IEEE 754-2008 floating point number.
Implementations§
source§impl RuntimeValue
impl RuntimeValue
sourcepub fn decode_f32(val: u32) -> Self
pub fn decode_f32(val: u32) -> Self
Creates new value by interpreting passed u32 as f32.
sourcepub fn decode_f64(val: u64) -> Self
pub fn decode_f64(val: u64) -> Self
Creates new value by interpreting passed u64 as f64.
sourcepub fn value_type(&self) -> ValueType
pub fn value_type(&self) -> ValueType
Get variable type for this value.
sourcepub fn try_into<T: FromRuntimeValue>(self) -> Option<T>
pub fn try_into<T: FromRuntimeValue>(self) -> Option<T>
Returns T
if this particular RuntimeValue
contains
appropriate type.
See FromRuntimeValue
for details.
Trait Implementations§
source§impl Clone for RuntimeValue
impl Clone for RuntimeValue
source§fn clone(&self) -> RuntimeValue
fn clone(&self) -> RuntimeValue
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for RuntimeValue
impl Debug for RuntimeValue
source§impl From<F32> for RuntimeValue
impl From<F32> for RuntimeValue
source§impl From<F64> for RuntimeValue
impl From<F64> for RuntimeValue
source§impl From<i16> for RuntimeValue
impl From<i16> for RuntimeValue
source§impl From<i32> for RuntimeValue
impl From<i32> for RuntimeValue
source§impl From<i64> for RuntimeValue
impl From<i64> for RuntimeValue
source§impl From<i8> for RuntimeValue
impl From<i8> for RuntimeValue
source§impl From<u16> for RuntimeValue
impl From<u16> for RuntimeValue
source§impl From<u32> for RuntimeValue
impl From<u32> for RuntimeValue
source§impl From<u64> for RuntimeValue
impl From<u64> for RuntimeValue
source§impl From<u8> for RuntimeValue
impl From<u8> for RuntimeValue
source§impl PartialEq<RuntimeValue> for RuntimeValue
impl PartialEq<RuntimeValue> for RuntimeValue
source§fn eq(&self, other: &RuntimeValue) -> bool
fn eq(&self, other: &RuntimeValue) -> bool
impl Copy for RuntimeValue
impl StructuralPartialEq for RuntimeValue
Auto Trait Implementations§
impl RefUnwindSafe for RuntimeValue
impl Send for RuntimeValue
impl Sync for RuntimeValue
impl Unpin for RuntimeValue
impl UnwindSafe for RuntimeValue
Blanket Implementations§
source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
source§fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
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
. Read moresource§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
. Read moresource§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s. Read moresource§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s. Read more