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
sourceimpl Value
impl Value
sourcepub fn decode_f32(val: u32) -> Value
👎 Deprecated: use F32::from_bits(val).into()
instead
pub fn decode_f32(val: u32) -> Value
use F32::from_bits(val).into()
instead
Creates new value by interpreting passed u32 as f32.
sourcepub fn decode_f64(val: u64) -> Value
👎 Deprecated: use F64::from_bits(val).into()
instead
pub fn decode_f64(val: u64) -> Value
use F64::from_bits(val).into()
instead
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.
Trait Implementations
impl Copy for Value
impl StructuralPartialEq for Value
Auto Trait Implementations
impl RefUnwindSafe for Value
impl Send for Value
impl Sync for Value
impl Unpin for Value
impl UnwindSafe for Value
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> Downcast for T where
T: Any,
impl<T> Downcast for T where
T: Any,
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, 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
. Read more
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
. Read more
fn as_any(&self) -> &(dyn Any + 'static)
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. Read more
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
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. Read more
sourceimpl<T1> EncodeUntypedSlice for T1 where
T1: Into<UntypedValue>,
impl<T1> EncodeUntypedSlice for T1 where
T1: Into<UntypedValue>,
sourcefn encode_untyped_slice(
self,
results: &mut [UntypedValue]
) -> Result<(), UntypedError>
fn encode_untyped_slice(
self,
results: &mut [UntypedValue]
) -> Result<(), UntypedError>
Encodes the slice of UntypedValue
from the given value of type Self
. Read more