Trait substrate_test_runtime_client::sc_executor::wasmi::FromRuntimeValue [−]
pub trait FromRuntimeValue { fn from_runtime_value(val: RuntimeValue) -> Option<Self>; }
Expand description
Trait for creating value from a RuntimeValue
.
Typically each implementation can create a value from the specific type.
For example, values of type bool
or u32
are both represented by I32
and f64
values are represented by
F64
.
Required methods
fn from_runtime_value(val: RuntimeValue) -> Option<Self>
fn from_runtime_value(val: RuntimeValue) -> Option<Self>
Create a value of type Self
from a given RuntimeValue
.
Returns None
if the RuntimeValue
is of type different than
expected by the conversion in question.
Implementations on Foreign Types
impl FromRuntimeValue for i8
impl FromRuntimeValue for i8
This conversion assumes that i8
is represented as an I32
.
pub fn from_runtime_value(val: RuntimeValue) -> Option<i8>
impl FromRuntimeValue for u32
impl FromRuntimeValue for u32
pub fn from_runtime_value(val: RuntimeValue) -> Option<u32>
impl FromRuntimeValue for i16
impl FromRuntimeValue for i16
This conversion assumes that i16
is represented as an I32
.
pub fn from_runtime_value(val: RuntimeValue) -> Option<i16>
impl FromRuntimeValue for i64
impl FromRuntimeValue for i64
pub fn from_runtime_value(val: RuntimeValue) -> Option<i64>
impl FromRuntimeValue for u64
impl FromRuntimeValue for u64
pub fn from_runtime_value(val: RuntimeValue) -> Option<u64>
impl FromRuntimeValue for i32
impl FromRuntimeValue for i32
pub fn from_runtime_value(val: RuntimeValue) -> Option<i32>
impl FromRuntimeValue for bool
impl FromRuntimeValue for bool
This conversion assumes that boolean values are represented by
I32
type.
pub fn from_runtime_value(val: RuntimeValue) -> Option<bool>
impl FromRuntimeValue for u16
impl FromRuntimeValue for u16
This conversion assumes that u16
is represented as an I32
.
pub fn from_runtime_value(val: RuntimeValue) -> Option<u16>
impl FromRuntimeValue for u8
impl FromRuntimeValue for u8
This conversion assumes that u8
is represented as an I32
.
pub fn from_runtime_value(val: RuntimeValue) -> Option<u8>
Implementors
impl FromRuntimeValue for F32
impl FromRuntimeValue for F64