Enum moore_vhdl::ty2::AnyType
source · [−]pub enum AnyType<'t> {
Enum(&'t dyn EnumType),
Integer(&'t dyn IntegerType),
Floating(&'t dyn FloatingType),
Physical(&'t dyn PhysicalType),
Array(&'t ArrayType<'t>),
Access(&'t AccessType<'t>),
Null,
UniversalInteger,
UniversalReal,
}
Expand description
A type.
This enum represents one of the types declared in this module. It is useful in code that needs to know exactly what type it is operating on, for example in a match expression. This is the root of the entire type system. If a user declares a type, this enum carries the information as to which type was declared.
Variants
Enum(&'t dyn EnumType)
Integer(&'t dyn IntegerType)
Floating(&'t dyn FloatingType)
Physical(&'t dyn PhysicalType)
Array(&'t ArrayType<'t>)
Access(&'t AccessType<'t>)
Null
UniversalInteger
UniversalReal
Implementations
sourceimpl<'t> AnyType<'t>
impl<'t> AnyType<'t>
sourcepub fn as_enum(self) -> Option<&'t dyn EnumType>
pub fn as_enum(self) -> Option<&'t dyn EnumType>
Returns Some(t)
if the type is Enum(t)
, None
otherwise.
sourcepub fn as_integer(self) -> Option<&'t dyn IntegerType>
pub fn as_integer(self) -> Option<&'t dyn IntegerType>
Returns Some(t)
if the type is Integer(t)
, None
otherwise.
sourcepub fn as_floating(self) -> Option<&'t dyn FloatingType>
pub fn as_floating(self) -> Option<&'t dyn FloatingType>
Returns Some(t)
if the type is Floating(t)
, None
otherwise.
sourcepub fn as_physical(self) -> Option<&'t dyn PhysicalType>
pub fn as_physical(self) -> Option<&'t dyn PhysicalType>
Returns Some(t)
if the type is Physical(t)
, None
otherwise.
sourcepub fn as_array(self) -> Option<&'t ArrayType<'t>>
pub fn as_array(self) -> Option<&'t ArrayType<'t>>
Returns Some(t)
if the type is Array(t)
, None
otherwise.
sourcepub fn as_access(self) -> Option<&'t AccessType<'t>>
pub fn as_access(self) -> Option<&'t AccessType<'t>>
Returns Some(t)
if the type is Access(t)
, None
otherwise.
sourcepub fn is_universal_integer(self) -> bool
pub fn is_universal_integer(self) -> bool
Checks if the type is UniversalInteger
.
sourcepub fn is_universal_real(self) -> bool
pub fn is_universal_real(self) -> bool
Checks if the type is UniversalReal
.
sourcepub fn unwrap_enum(self) -> &'t dyn EnumType
pub fn unwrap_enum(self) -> &'t dyn EnumType
Returns an &EnumType
or panics if the type is not Enum
.
sourcepub fn unwrap_integer(self) -> &'t dyn IntegerType
pub fn unwrap_integer(self) -> &'t dyn IntegerType
Returns an &IntegerType
or panics if the type is not Integer
.
sourcepub fn unwrap_floating(self) -> &'t dyn FloatingType
pub fn unwrap_floating(self) -> &'t dyn FloatingType
Returns an &FloatingType
or panics if the type is not Floating
.
sourcepub fn unwrap_physical(self) -> &'t dyn PhysicalType
pub fn unwrap_physical(self) -> &'t dyn PhysicalType
Returns an &PhysicalType
or panics if the type is not Physical
.
sourcepub fn unwrap_array(self) -> &'t ArrayType<'t>
pub fn unwrap_array(self) -> &'t ArrayType<'t>
Returns an &ArrayType
or panics if the type is not Array
.
sourcepub fn unwrap_access(self) -> &'t AccessType<'t>
pub fn unwrap_access(self) -> &'t AccessType<'t>
Returns an &AccessType
or panics if the type is not Access
.
sourcepub fn is_discrete(&self) -> bool
pub fn is_discrete(&self) -> bool
Check if this is a discrete type.
sourcepub fn is_numeric(&self) -> bool
pub fn is_numeric(&self) -> bool
Check if this is a numeric type.
sourcepub fn is_composite(&self) -> bool
pub fn is_composite(&self) -> bool
Check if this is a composite type.
Trait Implementations
impl<'t> Copy for AnyType<'t>
impl<'t> StructuralPartialEq for AnyType<'t>
Auto Trait Implementations
impl<'t> !RefUnwindSafe for AnyType<'t>
impl<'t> !Send for AnyType<'t>
impl<'t> !Sync for AnyType<'t>
impl<'t> Unpin for AnyType<'t>
impl<'t> !UnwindSafe for AnyType<'t>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more