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 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
sourceimpl Clone for RuntimeValue
impl Clone for RuntimeValue
sourcefn clone(&self) -> RuntimeValue
fn clone(&self) -> RuntimeValue
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for RuntimeValue
impl Debug for RuntimeValue
sourceimpl PartialEq<RuntimeValue> for RuntimeValue
impl PartialEq<RuntimeValue> for RuntimeValue
sourcefn eq(&self, other: &RuntimeValue) -> bool
fn eq(&self, other: &RuntimeValue) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &RuntimeValue) -> bool
fn ne(&self, other: &RuntimeValue) -> bool
This method tests for !=
.
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more