pub struct ValueAndType {
pub value: Value,
pub typ: WitType,
}Fields§
§value: Value§typ: WitTypeImplementations§
Trait Implementations§
Source§impl Clone for ValueAndType
impl Clone for ValueAndType
Source§fn clone(&self) -> ValueAndType
fn clone(&self) -> ValueAndType
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ValueAndType
impl Debug for ValueAndType
Source§impl Display for ValueAndType
impl Display for ValueAndType
Source§impl From<ValueAndType> for Value
impl From<ValueAndType> for Value
Source§fn from(value_and_type: ValueAndType) -> Self
fn from(value_and_type: ValueAndType) -> Self
Converts to this type from the input type.
Source§impl From<ValueAndType> for WitType
impl From<ValueAndType> for WitType
Source§fn from(value_and_type: ValueAndType) -> Self
fn from(value_and_type: ValueAndType) -> Self
Converts to this type from the input type.
Source§impl GetLiteralValue for ValueAndType
impl GetLiteralValue for ValueAndType
fn get_literal(&self) -> Option<LiteralValue>
Source§impl PartialEq for ValueAndType
impl PartialEq for ValueAndType
Source§impl WasmValue for ValueAndType
impl WasmValue for ValueAndType
Source§fn kind(&self) -> WasmTypeKind
fn kind(&self) -> WasmTypeKind
The kind of type of this value.
Source§fn make_string(val: Cow<'_, str>) -> Self
fn make_string(val: Cow<'_, str>) -> Self
Returns a new WasmValue of the given type. Read more
Source§fn make_list(
ty: &Self::Type,
vals: impl IntoIterator<Item = Self>,
) -> Result<Self, WasmValueError>
fn make_list( ty: &Self::Type, vals: impl IntoIterator<Item = Self>, ) -> Result<Self, WasmValueError>
Returns a new WasmValue of the given type. Read more
Source§fn make_record<'a>(
ty: &Self::Type,
fields: impl IntoIterator<Item = (&'a str, Self)>,
) -> Result<Self, WasmValueError>
fn make_record<'a>( ty: &Self::Type, fields: impl IntoIterator<Item = (&'a str, Self)>, ) -> Result<Self, WasmValueError>
Returns a new WasmValue of the given type. Read more
Source§fn make_tuple(
ty: &Self::Type,
vals: impl IntoIterator<Item = Self>,
) -> Result<Self, WasmValueError>
fn make_tuple( ty: &Self::Type, vals: impl IntoIterator<Item = Self>, ) -> Result<Self, WasmValueError>
Returns a new WasmValue of the given type. Read more
Source§fn make_variant(
ty: &Self::Type,
case: &str,
val: Option<Self>,
) -> Result<Self, WasmValueError>
fn make_variant( ty: &Self::Type, case: &str, val: Option<Self>, ) -> Result<Self, WasmValueError>
Returns a new WasmValue of the given type. Read more
Source§fn make_enum(ty: &Self::Type, case: &str) -> Result<Self, WasmValueError>
fn make_enum(ty: &Self::Type, case: &str) -> Result<Self, WasmValueError>
Returns a new WasmValue of the given type. Read more
Source§fn make_option(
ty: &Self::Type,
val: Option<Self>,
) -> Result<Self, WasmValueError>
fn make_option( ty: &Self::Type, val: Option<Self>, ) -> Result<Self, WasmValueError>
Returns a new WasmValue of the given type. Read more
Source§fn make_result(
ty: &Self::Type,
val: Result<Option<Self>, Option<Self>>,
) -> Result<Self, WasmValueError>
fn make_result( ty: &Self::Type, val: Result<Option<Self>, Option<Self>>, ) -> Result<Self, WasmValueError>
Returns a new WasmValue of the given type. Read more
Source§fn make_flags<'a>(
ty: &Self::Type,
names: impl IntoIterator<Item = &'a str>,
) -> Result<Self, WasmValueError>
fn make_flags<'a>( ty: &Self::Type, names: impl IntoIterator<Item = &'a str>, ) -> Result<Self, WasmValueError>
Returns a new WasmValue of the given type. Read more
Source§fn unwrap_bool(&self) -> bool
fn unwrap_bool(&self) -> bool
Returns the underlying value of the WasmValue, panicing if it’s the wrong type. Read more
Source§fn unwrap_s8(&self) -> i8
fn unwrap_s8(&self) -> i8
Returns the underlying value of the WasmValue, panicing if it’s the wrong type. Read more
Source§fn unwrap_s16(&self) -> i16
fn unwrap_s16(&self) -> i16
Returns the underlying value of the WasmValue, panicing if it’s the wrong type. Read more
Source§fn unwrap_s32(&self) -> i32
fn unwrap_s32(&self) -> i32
Returns the underlying value of the WasmValue, panicing if it’s the wrong type. Read more
Source§fn unwrap_s64(&self) -> i64
fn unwrap_s64(&self) -> i64
Returns the underlying value of the WasmValue, panicing if it’s the wrong type. Read more
Source§fn unwrap_u8(&self) -> u8
fn unwrap_u8(&self) -> u8
Returns the underlying value of the WasmValue, panicing if it’s the wrong type. Read more
Source§fn unwrap_u16(&self) -> u16
fn unwrap_u16(&self) -> u16
Returns the underlying value of the WasmValue, panicing if it’s the wrong type. Read more
Source§fn unwrap_u32(&self) -> u32
fn unwrap_u32(&self) -> u32
Returns the underlying value of the WasmValue, panicing if it’s the wrong type. Read more
Source§fn unwrap_u64(&self) -> u64
fn unwrap_u64(&self) -> u64
Returns the underlying value of the WasmValue, panicing if it’s the wrong type. Read more
Source§fn unwrap_f32(&self) -> f32
fn unwrap_f32(&self) -> f32
Returns the underlying value of the WasmValue, panicing if it’s the wrong type. Read more
Source§fn unwrap_f64(&self) -> f64
fn unwrap_f64(&self) -> f64
Returns the underlying value of the WasmValue, panicing if it’s the wrong type. Read more
Source§fn unwrap_char(&self) -> char
fn unwrap_char(&self) -> char
Returns the underlying value of the WasmValue, panicing if it’s the wrong type. Read more
Source§fn unwrap_string(&self) -> Cow<'_, str>
fn unwrap_string(&self) -> Cow<'_, str>
Returns the underlying value of the WasmValue, panicing if it’s the wrong type. Read more
Source§fn unwrap_list(&self) -> Box<dyn Iterator<Item = Cow<'_, Self>> + '_>
fn unwrap_list(&self) -> Box<dyn Iterator<Item = Cow<'_, Self>> + '_>
Returns an iterator of the element Vals of the list. Read more
Source§fn unwrap_record(
&self,
) -> Box<dyn Iterator<Item = (Cow<'_, str>, Cow<'_, Self>)> + '_>
fn unwrap_record( &self, ) -> Box<dyn Iterator<Item = (Cow<'_, str>, Cow<'_, Self>)> + '_>
Returns an iterator of the field names and Vals of the record. Read more
Source§fn unwrap_tuple(&self) -> Box<dyn Iterator<Item = Cow<'_, Self>> + '_>
fn unwrap_tuple(&self) -> Box<dyn Iterator<Item = Cow<'_, Self>> + '_>
Returns an iterator of the field Vals of the tuple. Read more
Source§fn unwrap_variant(&self) -> (Cow<'_, str>, Option<Cow<'_, Self>>)
fn unwrap_variant(&self) -> (Cow<'_, str>, Option<Cow<'_, Self>>)
Returns the variant case name and optional payload WasmValue of the variant. Read more
impl StructuralPartialEq for ValueAndType
Auto Trait Implementations§
impl Freeze for ValueAndType
impl RefUnwindSafe for ValueAndType
impl Send for ValueAndType
impl Sync for ValueAndType
impl Unpin for ValueAndType
impl UnsafeUnpin for ValueAndType
impl UnwindSafe for ValueAndType
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