[−][src]Type Definition moore_vhdl::ty2::EnumSubtype
type EnumSubtype<'t> = ScalarSubtype<'t, dyn EnumType, usize>;
A subtype of an enumeration type.
Implementations
impl<'t> EnumSubtype<'t>
[src]
pub fn new(
mark: &'t TypeMark<'t>,
range: Range<usize>
) -> Option<EnumSubtype<'t>>
[src]
mark: &'t TypeMark<'t>,
range: Range<usize>
) -> Option<EnumSubtype<'t>>
Create a new enumeration subtype.
Example
use moore_vhdl::ty2::{Type, TypeMark, EnumBasetype, EnumSubtype, Range}; use moore_common::name::get_name_table; let ty = EnumBasetype::new(vec![ "first".into(), "second".into(), '0'.into(), '1'.into(), ]); let tm = TypeMark::new( get_name_table().intern("MY_TYPE", false), &ty, ); let subty = EnumSubtype::new(&tm, Range::ascending(1usize, 2usize)).unwrap(); assert_eq!(format!("{}", subty), "MY_TYPE range second to '0'");
Trait Implementations
impl<'t> Display for EnumSubtype<'t>
[src]
impl<'t> EnumType for EnumSubtype<'t>
[src]
fn as_type(&self) -> &dyn Type
[src]
fn variants(&self) -> &[EnumVariant]
[src]
fn range(&self) -> Range<usize>
[src]
fn base_type(&self) -> &dyn Type
[src]
fn as_subtype(&self) -> Option<&EnumSubtype<'_>>
[src]
fn is_equal(&self, other: &dyn EnumType) -> bool
[src]
fn resolution_func(&self) -> Option<usize>
[src]
fn as_basetype(&self) -> Option<&EnumBasetype>
[src]
fn unwrap_basetype(&self) -> &EnumBasetype
[src]
fn unwrap_subtype(&self) -> &EnumSubtype<'_>
[src]
impl<'t> Type for EnumSubtype<'t>
[src]
fn is_scalar(&self) -> bool
[src]
fn is_discrete(&self) -> bool
[src]
fn is_numeric(&self) -> bool
[src]
fn is_composite(&self) -> bool
[src]
fn as_any(&self) -> AnyType<'_>
[src]
fn into_owned<'a>(self) -> OwnedType<'a> where
Self: 'a,
[src]
Self: 'a,
fn to_owned<'a>(&self) -> OwnedType<'a> where
Self: 'a,
[src]
Self: 'a,