Struct wasm_wave::value::Value

source ·
pub struct Value(/* private fields */);
Expand description

A Value is a WAVE value, and implements WasmValue.

Trait Implementations§

source§

impl Clone for Value

source§

fn clone(&self) -> Value

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Value

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'a> From<&'a str> for Value

source§

fn from(value: &'a str) -> Self

Converts to this type from the input type.
source§

impl<const N: usize, T: ValueTyped + Into<Value>> From<[T; N]> for Value

source§

fn from(values: [T; N]) -> Self

Converts to this type from the input type.
source§

impl<T1: ValueTyped + Into<Value>> From<(T1,)> for Value

source§

fn from((T1): (T1,)) -> Value

Converts to this type from the input type.
source§

impl<T1: ValueTyped + Into<Value>, T2: ValueTyped + Into<Value>> From<(T1, T2)> for Value

source§

fn from((T1, T2): (T1, T2)) -> Value

Converts to this type from the input type.
source§

impl<T1: ValueTyped + Into<Value>, T2: ValueTyped + Into<Value>, T3: ValueTyped + Into<Value>> From<(T1, T2, T3)> for Value

source§

fn from((T1, T2, T3): (T1, T2, T3)) -> Value

Converts to this type from the input type.
source§

impl<T1: ValueTyped + Into<Value>, T2: ValueTyped + Into<Value>, T3: ValueTyped + Into<Value>, T4: ValueTyped + Into<Value>> From<(T1, T2, T3, T4)> for Value

source§

fn from((T1, T2, T3, T4): (T1, T2, T3, T4)) -> Value

Converts to this type from the input type.
source§

impl<T1: ValueTyped + Into<Value>, T2: ValueTyped + Into<Value>, T3: ValueTyped + Into<Value>, T4: ValueTyped + Into<Value>, T5: ValueTyped + Into<Value>> From<(T1, T2, T3, T4, T5)> for Value

source§

fn from((T1, T2, T3, T4, T5): (T1, T2, T3, T4, T5)) -> Value

Converts to this type from the input type.
source§

impl<T1: ValueTyped + Into<Value>, T2: ValueTyped + Into<Value>, T3: ValueTyped + Into<Value>, T4: ValueTyped + Into<Value>, T5: ValueTyped + Into<Value>, T6: ValueTyped + Into<Value>> From<(T1, T2, T3, T4, T5, T6)> for Value

source§

fn from((T1, T2, T3, T4, T5, T6): (T1, T2, T3, T4, T5, T6)) -> Value

Converts to this type from the input type.
source§

impl<T1: ValueTyped + Into<Value>, T2: ValueTyped + Into<Value>, T3: ValueTyped + Into<Value>, T4: ValueTyped + Into<Value>, T5: ValueTyped + Into<Value>, T6: ValueTyped + Into<Value>, T7: ValueTyped + Into<Value>> From<(T1, T2, T3, T4, T5, T6, T7)> for Value

source§

fn from((T1, T2, T3, T4, T5, T6, T7): (T1, T2, T3, T4, T5, T6, T7)) -> Value

Converts to this type from the input type.
source§

impl<T1: ValueTyped + Into<Value>, T2: ValueTyped + Into<Value>, T3: ValueTyped + Into<Value>, T4: ValueTyped + Into<Value>, T5: ValueTyped + Into<Value>, T6: ValueTyped + Into<Value>, T7: ValueTyped + Into<Value>, T8: ValueTyped + Into<Value>> From<(T1, T2, T3, T4, T5, T6, T7, T8)> for Value

source§

fn from( (T1, T2, T3, T4, T5, T6, T7, T8): (T1, T2, T3, T4, T5, T6, T7, T8) ) -> Value

Converts to this type from the input type.
source§

impl<T1: ValueTyped + Into<Value>, T2: ValueTyped + Into<Value>, T3: ValueTyped + Into<Value>, T4: ValueTyped + Into<Value>, T5: ValueTyped + Into<Value>, T6: ValueTyped + Into<Value>, T7: ValueTyped + Into<Value>, T8: ValueTyped + Into<Value>, T9: ValueTyped + Into<Value>> From<(T1, T2, T3, T4, T5, T6, T7, T8, T9)> for Value

source§

fn from( (T1, T2, T3, T4, T5, T6, T7, T8, T9): (T1, T2, T3, T4, T5, T6, T7, T8, T9) ) -> Value

Converts to this type from the input type.
source§

impl<T1: ValueTyped + Into<Value>, T2: ValueTyped + Into<Value>, T3: ValueTyped + Into<Value>, T4: ValueTyped + Into<Value>, T5: ValueTyped + Into<Value>, T6: ValueTyped + Into<Value>, T7: ValueTyped + Into<Value>, T8: ValueTyped + Into<Value>, T9: ValueTyped + Into<Value>, T10: ValueTyped + Into<Value>> From<(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)> for Value

source§

fn from( (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10): (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10) ) -> Value

Converts to this type from the input type.
source§

impl<T1: ValueTyped + Into<Value>, T2: ValueTyped + Into<Value>, T3: ValueTyped + Into<Value>, T4: ValueTyped + Into<Value>, T5: ValueTyped + Into<Value>, T6: ValueTyped + Into<Value>, T7: ValueTyped + Into<Value>, T8: ValueTyped + Into<Value>, T9: ValueTyped + Into<Value>, T10: ValueTyped + Into<Value>, T11: ValueTyped + Into<Value>> From<(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11)> for Value

source§

fn from( (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11): (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11) ) -> Value

Converts to this type from the input type.
source§

impl<T1: ValueTyped + Into<Value>, T2: ValueTyped + Into<Value>, T3: ValueTyped + Into<Value>, T4: ValueTyped + Into<Value>, T5: ValueTyped + Into<Value>, T6: ValueTyped + Into<Value>, T7: ValueTyped + Into<Value>, T8: ValueTyped + Into<Value>, T9: ValueTyped + Into<Value>, T10: ValueTyped + Into<Value>, T11: ValueTyped + Into<Value>, T12: ValueTyped + Into<Value>> From<(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12)> for Value

source§

fn from( (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12): (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12) ) -> Value

Converts to this type from the input type.
source§

impl<T1: ValueTyped + Into<Value>, T2: ValueTyped + Into<Value>, T3: ValueTyped + Into<Value>, T4: ValueTyped + Into<Value>, T5: ValueTyped + Into<Value>, T6: ValueTyped + Into<Value>, T7: ValueTyped + Into<Value>, T8: ValueTyped + Into<Value>, T9: ValueTyped + Into<Value>, T10: ValueTyped + Into<Value>, T11: ValueTyped + Into<Value>, T12: ValueTyped + Into<Value>, T13: ValueTyped + Into<Value>> From<(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13)> for Value

source§

fn from( (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13): (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13) ) -> Value

Converts to this type from the input type.
source§

impl<T1: ValueTyped + Into<Value>, T2: ValueTyped + Into<Value>, T3: ValueTyped + Into<Value>, T4: ValueTyped + Into<Value>, T5: ValueTyped + Into<Value>, T6: ValueTyped + Into<Value>, T7: ValueTyped + Into<Value>, T8: ValueTyped + Into<Value>, T9: ValueTyped + Into<Value>, T10: ValueTyped + Into<Value>, T11: ValueTyped + Into<Value>, T12: ValueTyped + Into<Value>, T13: ValueTyped + Into<Value>, T14: ValueTyped + Into<Value>> From<(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14)> for Value

source§

fn from( (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14): (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14) ) -> Value

Converts to this type from the input type.
source§

impl<T1: ValueTyped + Into<Value>, T2: ValueTyped + Into<Value>, T3: ValueTyped + Into<Value>, T4: ValueTyped + Into<Value>, T5: ValueTyped + Into<Value>, T6: ValueTyped + Into<Value>, T7: ValueTyped + Into<Value>, T8: ValueTyped + Into<Value>, T9: ValueTyped + Into<Value>, T10: ValueTyped + Into<Value>, T11: ValueTyped + Into<Value>, T12: ValueTyped + Into<Value>, T13: ValueTyped + Into<Value>, T14: ValueTyped + Into<Value>, T15: ValueTyped + Into<Value>> From<(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15)> for Value

source§

fn from( (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15): (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15) ) -> Value

Converts to this type from the input type.
source§

impl<T1: ValueTyped + Into<Value>, T2: ValueTyped + Into<Value>, T3: ValueTyped + Into<Value>, T4: ValueTyped + Into<Value>, T5: ValueTyped + Into<Value>, T6: ValueTyped + Into<Value>, T7: ValueTyped + Into<Value>, T8: ValueTyped + Into<Value>, T9: ValueTyped + Into<Value>, T10: ValueTyped + Into<Value>, T11: ValueTyped + Into<Value>, T12: ValueTyped + Into<Value>, T13: ValueTyped + Into<Value>, T14: ValueTyped + Into<Value>, T15: ValueTyped + Into<Value>, T16: ValueTyped + Into<Value>> From<(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16)> for Value

source§

fn from( (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16): (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16) ) -> Value

Converts to this type from the input type.
source§

impl<T: ValueTyped + Into<Value>> From<Option<T>> for Value

source§

fn from(value: Option<T>) -> Self

Converts to this type from the input type.
source§

impl<T: ValueTyped + Into<Value>, U: ValueTyped + Into<Value>> From<Result<T, U>> for Value

source§

fn from(value: Result<T, U>) -> Self

Converts to this type from the input type.
source§

impl From<String> for Value

source§

fn from(value: String) -> Self

Converts to this type from the input type.
source§

impl<T: ValueTyped + Into<Value>> From<Vec<T>> for Value

source§

fn from(values: Vec<T>) -> Self

Converts to this type from the input type.
source§

impl From<bool> for Value

source§

fn from(value: bool) -> Self

Converts to this type from the input type.
source§

impl From<char> for Value

source§

fn from(value: char) -> Self

Converts to this type from the input type.
source§

impl From<f32> for Value

source§

fn from(value: f32) -> Self

Converts to this type from the input type.
source§

impl From<f64> for Value

source§

fn from(value: f64) -> Self

Converts to this type from the input type.
source§

impl From<i16> for Value

source§

fn from(value: i16) -> Self

Converts to this type from the input type.
source§

impl From<i32> for Value

source§

fn from(value: i32) -> Self

Converts to this type from the input type.
source§

impl From<i64> for Value

source§

fn from(value: i64) -> Self

Converts to this type from the input type.
source§

impl From<i8> for Value

source§

fn from(value: i8) -> Self

Converts to this type from the input type.
source§

impl From<u16> for Value

source§

fn from(value: u16) -> Self

Converts to this type from the input type.
source§

impl From<u32> for Value

source§

fn from(value: u32) -> Self

Converts to this type from the input type.
source§

impl From<u64> for Value

source§

fn from(value: u64) -> Self

Converts to this type from the input type.
source§

impl From<u8> for Value

source§

fn from(value: u8) -> Self

Converts to this type from the input type.
source§

impl PartialEq for Value

source§

fn eq(&self, other: &Value) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl WasmValue for Value

§

type Type = Type

A type representing types of these values.
source§

fn kind(&self) -> WasmTypeKind

The kind of type of this value.
source§

fn make_bool(val: bool) -> Self

Returns a new WasmValue of the given type. Read more
source§

fn unwrap_bool(&self) -> bool

Returns the underlying value of the WasmValue, panicing if it’s the wrong type. Read more
source§

fn make_s8(val: i8) -> Self

Returns a new WasmValue of the given type. Read more
source§

fn unwrap_s8(&self) -> i8

Returns the underlying value of the WasmValue, panicing if it’s the wrong type. Read more
source§

fn make_s16(val: i16) -> Self

Returns a new WasmValue of the given type. Read more
source§

fn unwrap_s16(&self) -> i16

Returns the underlying value of the WasmValue, panicing if it’s the wrong type. Read more
source§

fn make_s32(val: i32) -> Self

Returns a new WasmValue of the given type. Read more
source§

fn unwrap_s32(&self) -> i32

Returns the underlying value of the WasmValue, panicing if it’s the wrong type. Read more
source§

fn make_s64(val: i64) -> Self

Returns a new WasmValue of the given type. Read more
source§

fn unwrap_s64(&self) -> i64

Returns the underlying value of the WasmValue, panicing if it’s the wrong type. Read more
source§

fn make_u8(val: u8) -> Self

Returns a new WasmValue of the given type. Read more
source§

fn unwrap_u8(&self) -> u8

Returns the underlying value of the WasmValue, panicing if it’s the wrong type. Read more
source§

fn make_u16(val: u16) -> Self

Returns a new WasmValue of the given type. Read more
source§

fn unwrap_u16(&self) -> u16

Returns the underlying value of the WasmValue, panicing if it’s the wrong type. Read more
source§

fn make_u32(val: u32) -> Self

Returns a new WasmValue of the given type. Read more
source§

fn unwrap_u32(&self) -> u32

Returns the underlying value of the WasmValue, panicing if it’s the wrong type. Read more
source§

fn make_u64(val: u64) -> Self

Returns a new WasmValue of the given type. Read more
source§

fn unwrap_u64(&self) -> u64

Returns the underlying value of the WasmValue, panicing if it’s the wrong type. Read more
source§

fn make_char(val: char) -> Self

Returns a new WasmValue of the given type. Read more
source§

fn unwrap_char(&self) -> char

Returns the underlying value of the WasmValue, panicing if it’s the wrong type. Read more
source§

fn make_float32(val: f32) -> Self

Returns a new WasmValue of the given type. Read more
source§

fn make_float64(val: f64) -> Self

Returns a new WasmValue of the given type. Read more
source§

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>

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>

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>

Returns a new WasmValue of the given type. Read more
source§

fn make_variant( ty: &Self::Type, case_name: &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>

Returns a new WasmValue of the given type. Read more
source§

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>

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>

Returns a new WasmValue of the given type. Read more
source§

fn unwrap_float32(&self) -> f32

Returns the underlying value of the WasmValue, panicing if it’s the wrong type. Read more
source§

fn unwrap_float64(&self) -> f64

Returns the underlying value of the WasmValue, panicing if it’s the wrong type. Read more
source§

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>> + '_>

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>)> + '_>

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>> + '_>

Returns an iterator of the field Vals of the tuple. Read more
source§

fn unwrap_variant(&self) -> (Cow<'_, str>, Option<Cow<'_, Self>>)

Returns the variant case name and optional payload WasmValue of the variant. Read more
source§

fn unwrap_enum(&self) -> Cow<'_, str>

Returns the case name of the enum. Read more
source§

fn unwrap_option(&self) -> Option<Cow<'_, Self>>

Returns the optional WasmValue. Read more
source§

fn unwrap_result(&self) -> Result<Option<Cow<'_, Self>>, Option<Cow<'_, Self>>>

Returns Ok() or Err() with the optional payload WasmValue. Read more
source§

fn unwrap_flags(&self) -> Box<dyn Iterator<Item = Cow<'_, str>> + '_>

Returns an iterator of the names of the flags WasmValue. Read more
source§

impl StructuralPartialEq for Value

Auto Trait Implementations§

§

impl Freeze for Value

§

impl RefUnwindSafe for Value

§

impl Send for Value

§

impl Sync for Value

§

impl Unpin for Value

§

impl UnwindSafe for Value

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.