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

Convert to a type.

The range of values this physical type can assume.

The units of measure of this type.

The index of the primary unit.

The base type of this physical type.

Check if two physical types are equal.

Provided methods

The resolution function associated with this type.

Returns Some if self is a PhysicalBasetype, None otherwise.

Returns Some if self is a PhysicalSubtype, None otherwise.

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

Returns an &PhysicalSubtype 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