[−][src]Trait moore_vhdl::ty2::EnumType
An enumeration type.
This can either be an EnumBasetype
or an EnumSubtype
.
Required methods
pub fn as_type(&self) -> &dyn Type
[src]
Convert to a type.
pub fn variants(&self) -> &[EnumVariant]ⓘ
[src]
The variants of this enumeration type.
pub fn range(&self) -> Range<usize>
[src]
The range of variants this type can assume.
This is used to support subtyping of enumerations, where a subtype might only accept a subrange of the original variants.
pub fn base_type(&self) -> &dyn Type
[src]
The base type of this enumeration.
pub fn is_equal(&self, other: &dyn EnumType) -> bool
[src]
Check if two enumeration types are equal.
Provided methods
pub fn resolution_func(&self) -> Option<usize>
[src]
The resolution function associated with this type.
pub fn as_basetype(&self) -> Option<&EnumBasetype>
[src]
Returns Some
if self is an EnumBasetype
, None
otherwise.
pub fn as_subtype(&self) -> Option<&EnumSubtype<'_>>
[src]
Returns Some
if self is an EnumSubtype
, None
otherwise.
pub fn unwrap_basetype(&self) -> &EnumBasetype
[src]
Returns an &EnumBasetype
or panics if the type is not a basetype.
pub fn unwrap_subtype(&self) -> &EnumSubtype<'_>
[src]
Returns an &EnumSubtype
or panics if the type is not a subtype.