Enum substrate_test_runtime_client::sc_executor::wasmi::RuntimeValue [−]
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
impl RuntimeValue
impl RuntimeValue
pub fn default(value_type: ValueType) -> RuntimeValue
pub fn default(value_type: ValueType) -> RuntimeValue
Creates new default value of given type.
pub fn decode_f32(val: u32) -> RuntimeValue
pub fn decode_f32(val: u32) -> RuntimeValue
Creates new value by interpreting passed u32 as f32.
pub fn decode_f64(val: u64) -> RuntimeValue
pub fn decode_f64(val: u64) -> RuntimeValue
Creates new value by interpreting passed u64 as f64.
pub fn value_type(&self) -> ValueType
pub fn value_type(&self) -> ValueType
Get variable type for this value.
pub fn try_into<T>(self) -> Option<T> where
T: FromRuntimeValue,
pub fn try_into<T>(self) -> Option<T> where
T: FromRuntimeValue,
Returns T
if this particular RuntimeValue
contains
appropriate type.
See FromRuntimeValue
for details.
Trait Implementations
impl Clone for RuntimeValue
impl Clone for RuntimeValue
pub fn clone(&self) -> RuntimeValue
pub fn clone(&self) -> RuntimeValue
Returns a copy of the value. Read more
Performs copy-assignment from source
. Read more
impl Debug for RuntimeValue
impl Debug for RuntimeValue
impl From<F32> for RuntimeValue
impl From<F32> for RuntimeValue
pub fn from(val: F32) -> RuntimeValue
pub fn from(val: F32) -> RuntimeValue
Performs the conversion.
impl From<F64> for RuntimeValue
impl From<F64> for RuntimeValue
pub fn from(val: F64) -> RuntimeValue
pub fn from(val: F64) -> RuntimeValue
Performs the conversion.
Performs the conversion.
Performs the conversion.
impl From<i16> for RuntimeValue
impl From<i16> for RuntimeValue
pub fn from(val: i16) -> RuntimeValue
pub fn from(val: i16) -> RuntimeValue
Performs the conversion.
impl From<i32> for RuntimeValue
impl From<i32> for RuntimeValue
pub fn from(val: i32) -> RuntimeValue
pub fn from(val: i32) -> RuntimeValue
Performs the conversion.
impl From<i64> for RuntimeValue
impl From<i64> for RuntimeValue
pub fn from(val: i64) -> RuntimeValue
pub fn from(val: i64) -> RuntimeValue
Performs the conversion.
impl From<i8> for RuntimeValue
impl From<i8> for RuntimeValue
pub fn from(val: i8) -> RuntimeValue
pub fn from(val: i8) -> RuntimeValue
Performs the conversion.
impl From<u16> for RuntimeValue
impl From<u16> for RuntimeValue
pub fn from(val: u16) -> RuntimeValue
pub fn from(val: u16) -> RuntimeValue
Performs the conversion.
impl From<u32> for RuntimeValue
impl From<u32> for RuntimeValue
pub fn from(val: u32) -> RuntimeValue
pub fn from(val: u32) -> RuntimeValue
Performs the conversion.
impl From<u64> for RuntimeValue
impl From<u64> for RuntimeValue
pub fn from(val: u64) -> RuntimeValue
pub fn from(val: u64) -> RuntimeValue
Performs the conversion.
impl From<u8> for RuntimeValue
impl From<u8> for RuntimeValue
pub fn from(val: u8) -> RuntimeValue
pub fn from(val: u8) -> RuntimeValue
Performs the conversion.
impl PartialEq<RuntimeValue> for RuntimeValue
impl PartialEq<RuntimeValue> for RuntimeValue
pub fn eq(&self, other: &RuntimeValue) -> bool
pub fn eq(&self, other: &RuntimeValue) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
pub fn ne(&self, other: &RuntimeValue) -> bool
pub 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
Mutably borrows from an owned value. Read more
impl<T> Downcast for T where
T: Any,
impl<T> Downcast for T where
T: Any,
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
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
pub 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
Convert &Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s. Read more
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
pub 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
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
type Output = T
type Output = T
Should always be Self
The inverse inclusion map: attempts to construct self
from the equivalent element of its
superset. Read more
pub fn is_in_subset(&self) -> bool
pub fn is_in_subset(&self) -> bool
Checks if self
is actually part of its subset T
(and can be converted to it).
pub fn to_subset_unchecked(&self) -> SS
pub fn to_subset_unchecked(&self) -> SS
Use with care! Same as self.to_subset
but without any property checks. Always succeeds.
pub fn from_subset(element: &SS) -> SP
pub fn from_subset(element: &SS) -> SP
The inclusion map: converts self
to the equivalent element of its superset.
The counterpart to unchecked_from
.
Consume self to return an equivalent value of T
.
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
impl<T> MaybeDebug for T where
T: Debug,
impl<T> MaybeDebug for T where
T: Debug,