TypeDecl::variants
pub fn variants() -> Vec<Variant> Import
Source: use macro::{TypeDecl}; compiler/src/prelude/macro.hy Enum variants (empty for a class).
Called on a TypeDecl value as value.variants(…).
Returns#
Vec<Variant>
See also#
TypeDecl: A class or enum declaration handed to a derive or attribute macro.TypeDecl::is_classTypeDecl::self_type: The type as written in a signature:Name, orName<T, U>for a generic type.TypeDecl::impl_head: Head of animpl Trait for …for this type:Name, or for a generic typeName<T: bound, U: bound>, every type parameter bounded bybound("Show","Ord + Eq").TypeDecl::is_enumTypeDecl::fields: Class fields (empty for an enum).TypeDecl::has_attrTypeDecl::attr_str