Trait moore_vhdl::ty2::Type [−][src]
pub trait Type: Debug + Display {
fn is_scalar(&self) -> bool;
fn is_discrete(&self) -> bool;
fn is_numeric(&self) -> bool;
fn is_composite(&self) -> bool;
fn into_owned<'a>(self) -> OwnedType<'a>
where
Self: 'a;
fn to_owned<'a>(&self) -> OwnedType<'a>
where
Self: 'a;
fn as_any(&self) -> AnyType<'_>;
fn is_equal(&self, other: &dyn Type) -> bool { ... }
fn is_implicitly_castable(&self, _into: &dyn Type) -> bool { ... }
}
Expand description
An interface for dealing with types.
This is the main type trait, which all types and subtypes implement.
Required methods
Check if this is a scalar type.
Enumeration, integer, floating-point, and physical types are scalar.
fn is_discrete(&self) -> bool
fn is_discrete(&self) -> bool
Check if this is a discrete type.
Enumeration and integer types are discrete.
fn is_numeric(&self) -> bool
fn is_numeric(&self) -> bool
Check if this is a numeric type.
Integer, floating-point, and physical types are numeric.
fn is_composite(&self) -> bool
fn is_composite(&self) -> bool
Check if this is a composite type.
Array and record types are composite.
fn into_owned<'a>(self) -> OwnedType<'a> where
Self: 'a,
fn into_owned<'a>(self) -> OwnedType<'a> where
Self: 'a,
Convert into an owned type.
Provided methods
fn is_implicitly_castable(&self, _into: &dyn Type) -> bool
fn is_implicitly_castable(&self, _into: &dyn Type) -> bool
Check if the type can be implicitly cast to another.