pub struct TypeVariant {
pub cases: TryIndexMap<TryString, Option<InterfaceType>>,
pub abi: CanonicalAbiInfo,
pub info: VariantInfo,
}Expand description
Shape of a “variant” type in interface types.
Variants are close to Rust enum declarations where a value is one of many
cases and each case has a unique name and an optional payload associated
with it.
Fields§
§cases: TryIndexMap<TryString, Option<InterfaceType>>The list of cases that this variant can take.
abi: CanonicalAbiInfoByte information about this type in the canonical ABI.
info: VariantInfoByte information about this variant type.
Trait Implementations§
Source§impl Debug for TypeVariant
impl Debug for TypeVariant
Source§impl<'de> Deserialize<'de> for TypeVariant
impl<'de> Deserialize<'de> for TypeVariant
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
impl Eq for TypeVariant
Source§impl Hash for TypeVariant
impl Hash for TypeVariant
Source§impl PartialEq for TypeVariant
impl PartialEq for TypeVariant
Source§impl Serialize for TypeVariant
impl Serialize for TypeVariant
Source§impl TryClone for TypeVariant
impl TryClone for TypeVariant
Source§fn try_clone(&self) -> Result<Self, OutOfMemory>
fn try_clone(&self) -> Result<Self, OutOfMemory>
Attempt to clone
self, returning an error if any allocation fails
during cloning.§fn clone_panic_on_oom(&self) -> Self
fn clone_panic_on_oom(&self) -> Self
Clone
self, panicking on allocation failure.Auto Trait Implementations§
impl Freeze for TypeVariant
impl RefUnwindSafe for TypeVariant
impl Send for TypeVariant
impl Sync for TypeVariant
impl Unpin for TypeVariant
impl UnsafeUnpin for TypeVariant
impl UnwindSafe for TypeVariant
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
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<T> TryToOwned for Twhere
T: TryClone,
impl<T> TryToOwned for Twhere
T: TryClone,
§fn try_to_owned(&self) -> Result<<T as TryToOwned>::Owned, OutOfMemory>
fn try_to_owned(&self) -> Result<<T as TryToOwned>::Owned, OutOfMemory>
Try to allocate an owned version of
self.