[−][src]Trait moore_vhdl::ty2::PhysicalType
A physical type.
This can either be an PhysicalBasetype
or a PhysicalSubtype
.
Required methods
fn as_type(&self) -> &dyn Type
Convert to a type.
fn range(&self) -> &Range<BigInt>
The range of values this physical type can assume.
fn units(&self) -> &[PhysicalUnit]
The units of measure of this type.
fn primary_index(&self) -> usize
The index of the primary unit.
fn base_type(&self) -> &dyn Type
The base type of this physical type.
fn is_equal(&self, other: &dyn PhysicalType) -> bool
Check if two physical types are equal.
Provided methods
fn resolution_func(&self) -> Option<usize>
The resolution function associated with this type.
fn as_basetype(&self) -> Option<&PhysicalBasetype>
Returns Some
if self is a PhysicalBasetype
, None
otherwise.
fn as_subtype(&self) -> Option<&PhysicalSubtype>
Returns Some
if self is a PhysicalSubtype
, None
otherwise.
fn unwrap_basetype(&self) -> &PhysicalBasetype
Returns an &PhysicalBasetype
or panics if the type is not a basetype.
fn unwrap_subtype(&self) -> &PhysicalSubtype
Returns an &PhysicalSubtype
or panics if the type is not a subtype.