[−][src]Type Definition moore_vhdl::ty2::IntegerSubtype
type IntegerSubtype<'t> = ScalarSubtype<'t, dyn IntegerType, BigInt>;
A subtype of an integer type.
Implementations
impl<'t> IntegerSubtype<'t>
[src]
pub fn new(
mark: &'t TypeMark<'t>,
range: Range<BigInt>
) -> Option<IntegerSubtype<'t>>
[src]
mark: &'t TypeMark<'t>,
range: Range<BigInt>
) -> Option<IntegerSubtype<'t>>
Create a new integer subtype.
Returns Some(...)
if range
is a subrange of the integer, or None
otherwise.
Example
use moore_vhdl::ty2::{Type, TypeMark, IntegerBasetype, IntegerSubtype, Range}; use moore_common::name::get_name_table; let ty = IntegerBasetype::new(Range::ascending(0usize, 255usize)); let tm = TypeMark::new( get_name_table().intern("BYTE", false), &ty, ); let a = IntegerSubtype::new(&tm, Range::ascending(0usize, 15usize)).unwrap(); let b = IntegerSubtype::new(&tm, Range::descending(15usize, 0usize)).unwrap(); assert_eq!(format!("{}", a), "BYTE range 0 to 15"); assert_eq!(format!("{}", b), "BYTE range 15 downto 0");
Trait Implementations
impl<'t> Display for IntegerSubtype<'t>
[src]
impl<'t> IntegerType for IntegerSubtype<'t>
[src]
pub fn as_type(&self) -> &dyn Type
[src]
pub fn range(&self) -> Option<&Range<BigInt>>
[src]
pub fn base_type(&self) -> &dyn Type
[src]
pub fn as_subtype(&self) -> Option<&IntegerSubtype<'_>>
[src]
pub fn is_equal(&self, other: &dyn IntegerType) -> bool
[src]
pub fn resolution_func(&self) -> Option<usize>
[src]
pub fn as_basetype(&self) -> Option<&IntegerBasetype>
[src]
pub fn is_universal(&self) -> bool
[src]
pub fn unwrap_basetype(&self) -> &IntegerBasetype
[src]
pub fn unwrap_subtype(&self) -> &IntegerSubtype<'_>
[src]
impl<'t> Type for IntegerSubtype<'t>
[src]
pub fn is_scalar(&self) -> bool
[src]
pub fn is_discrete(&self) -> bool
[src]
pub fn is_numeric(&self) -> bool
[src]
pub fn is_composite(&self) -> bool
[src]
pub fn as_any(&self) -> AnyType<'_>
[src]
pub fn into_owned<'a>(self) -> OwnedType<'a> where
Self: 'a,
[src]
Self: 'a,
pub fn to_owned<'a>(&self) -> OwnedType<'a> where
Self: 'a,
[src]
Self: 'a,