pub enum WasmValue {
I32(i32),
I64(i64),
F32(f32),
F64(f64),
Bool(bool),
String(String),
Bytes(Vec<u8>),
Null,
Array(Vec<WasmValue>),
Map(HashMap<String, WasmValue>),
}Expand description
WASM value types
Variants§
I32(i32)
32-bit integer
I64(i64)
64-bit integer
F32(f32)
32-bit float
F64(f64)
64-bit float
Bool(bool)
Boolean
String(String)
String
Bytes(Vec<u8>)
Byte array
Null
Null value
Array(Vec<WasmValue>)
Array of values
Map(HashMap<String, WasmValue>)
Map of values
Implementations§
Source§impl WasmValue
impl WasmValue
pub fn as_i32(&self) -> Option<i32>
pub fn as_i64(&self) -> Option<i64>
pub fn as_f32(&self) -> Option<f32>
pub fn as_f64(&self) -> Option<f64>
pub fn as_bool(&self) -> Option<bool>
pub fn as_string(&self) -> Option<&str>
pub fn as_bytes(&self) -> Option<&[u8]>
pub fn is_null(&self) -> bool
Trait Implementations§
Source§impl<'de> Deserialize<'de> for WasmValue
impl<'de> Deserialize<'de> for WasmValue
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<WasmValue, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<WasmValue, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for WasmValue
impl Serialize for WasmValue
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for WasmValue
Auto Trait Implementations§
impl Freeze for WasmValue
impl RefUnwindSafe for WasmValue
impl Send for WasmValue
impl Sync for WasmValue
impl Unpin for WasmValue
impl UnsafeUnpin for WasmValue
impl UnwindSafe for WasmValue
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Message for T
impl<T> Message for T
Source§fn from_boxed(m: BoxedMessage) -> Result<Self, BoxedDowncastErr>
fn from_boxed(m: BoxedMessage) -> Result<Self, BoxedDowncastErr>
Convert a BoxedMessage to this concrete type
Source§fn box_message(self, pid: &ActorId) -> Result<BoxedMessage, BoxedDowncastErr>
fn box_message(self, pid: &ActorId) -> Result<BoxedMessage, BoxedDowncastErr>
Convert this message to a BoxedMessage