Trait moore_vhdl::ty2::EnumType[][src]

pub trait EnumType: Type {
    fn as_type(&self) -> &dyn Type;
fn variants(&self) -> &[EnumVariant]
Notable traits for &'_ mut [u8]
impl<'_> Write for &'_ mut [u8]impl<'_> Read for &'_ [u8]
;
fn range(&self) -> Range<usize>;
fn base_type(&self) -> &dyn Type;
fn is_equal(&self, other: &dyn EnumType) -> bool; fn resolution_func(&self) -> Option<usize> { ... }
fn as_basetype(&self) -> Option<&EnumBasetype> { ... }
fn as_subtype(&self) -> Option<&EnumSubtype<'_>> { ... }
fn unwrap_basetype(&self) -> &EnumBasetype { ... }
fn unwrap_subtype(&self) -> &EnumSubtype<'_> { ... } }
Expand description

An enumeration type.

This can either be an EnumBasetype or an EnumSubtype.

Required methods

Convert to a type.

The variants of this enumeration type.

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.

The base type of this enumeration.

Check if two enumeration types are equal.

Provided methods

The resolution function associated with this type.

Returns Some if self is an EnumBasetype, None otherwise.

Returns Some if self is an EnumSubtype, None otherwise.

Returns an &EnumBasetype or panics if the type is not a basetype.

Returns an &EnumSubtype or panics if the type is not a subtype.

Trait Implementations

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Implementors