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