pub enum WitType {
Show 22 variants
Variant(TypeVariant),
Result(TypeResult),
Option(TypeOption),
Enum(TypeEnum),
Flags(TypeFlags),
Record(TypeRecord),
Tuple(TypeTuple),
List(TypeList),
Str(TypeStr),
Chr(TypeChr),
F64(TypeF64),
F32(TypeF32),
U64(TypeU64),
S64(TypeS64),
U32(TypeU32),
S32(TypeS32),
U16(TypeU16),
S16(TypeS16),
U8(TypeU8),
S8(TypeS8),
Bool(TypeBool),
Handle(TypeHandle),
}Variants§
Variant(TypeVariant)
Result(TypeResult)
Option(TypeOption)
Enum(TypeEnum)
Flags(TypeFlags)
Record(TypeRecord)
Tuple(TypeTuple)
List(TypeList)
Str(TypeStr)
Chr(TypeChr)
F64(TypeF64)
F32(TypeF32)
U64(TypeU64)
S64(TypeS64)
U32(TypeU32)
S32(TypeS32)
U16(TypeU16)
S16(TypeS16)
U8(TypeU8)
S8(TypeS8)
Bool(TypeBool)
Handle(TypeHandle)
Implementations§
Source§impl WitType
impl WitType
pub fn name(&self) -> Option<&str>
pub fn with_optional_name(self, name: Option<String>) -> Self
pub fn named(self, name: impl AsRef<str>) -> Self
pub fn owner(&self) -> Option<&str>
pub fn with_optional_owner(self, owner: Option<String>) -> Self
pub fn owned(self, owner: impl AsRef<str>) -> Self
pub fn contains_handle(&self) -> bool
Trait Implementations§
Source§impl<'de> Deserialize<'de> for WitType
impl<'de> Deserialize<'de> for WitType
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<&WitType> for InferredType
impl From<&WitType> for InferredType
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 GetTypeHint for WitType
impl GetTypeHint for WitType
fn get_type_hint(&self) -> TypeHint
Source§impl TryFrom<&InferredType> for WitType
impl TryFrom<&InferredType> for WitType
Source§impl TryFrom<WitTypeWithUnit> for WitType
impl TryFrom<WitTypeWithUnit> for WitType
Source§impl WasmType for WitType
impl WasmType for WitType
Source§fn kind(&self) -> WasmTypeKind
fn kind(&self) -> WasmTypeKind
Returns the
WasmTypeKind of this type.Source§fn list_element_type(&self) -> Option<Self>
fn list_element_type(&self) -> Option<Self>
Source§fn record_fields(&self) -> Box<dyn Iterator<Item = (Cow<'_, str>, Self)> + '_>
fn record_fields(&self) -> Box<dyn Iterator<Item = (Cow<'_, str>, Self)> + '_>
Returns an iterator of the record’s field names and Types. The
iterator will be empty iff
self is not a record type. Read moreSource§fn tuple_element_types(&self) -> Box<dyn Iterator<Item = Self> + '_>
fn tuple_element_types(&self) -> Box<dyn Iterator<Item = Self> + '_>
Returns an iterator of the tuple’s field Types. The iterator will be
empty iff
self is not a tuple type. Read moreSource§fn variant_cases(
&self,
) -> Box<dyn Iterator<Item = (Cow<'_, str>, Option<Self>)> + '_>
fn variant_cases( &self, ) -> Box<dyn Iterator<Item = (Cow<'_, str>, Option<Self>)> + '_>
Returns an iterator of the variant’s case names and optional payload
Types. The iterator will be empty iff
self is not a tuple type. Read moreSource§fn enum_cases(&self) -> Box<dyn Iterator<Item = Cow<'_, str>> + '_>
fn enum_cases(&self) -> Box<dyn Iterator<Item = Cow<'_, str>> + '_>
Returns an iterator of the enum’s case names. The iterator will be
empty iff
self is not an enum type. Read moreSource§fn option_some_type(&self) -> Option<Self>
fn option_some_type(&self) -> Option<Self>
impl Eq for WitType
impl StructuralPartialEq for WitType
Auto Trait Implementations§
impl Freeze for WitType
impl RefUnwindSafe for WitType
impl Send for WitType
impl Sync for WitType
impl Unpin for WitType
impl UnsafeUnpin for WitType
impl UnwindSafe for WitType
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.