Struct moore_vhdl::ty2::UniversalIntegerType
source · [−]pub struct UniversalIntegerType;
Expand description
A universal integer.
This is not strictly a separate type, but rather defined by the standard as
the integer type with the largest range. However since we can represent
arbitrary numbers as BigInt
, we use this special marker type.
Example
use moore_vhdl::ty2::{Type, UniversalIntegerType};
let ty = UniversalIntegerType;
assert_eq!(format!("{}", ty), "{universal integer}");
assert_eq!(ty.is_scalar(), true);
assert_eq!(ty.is_discrete(), true);
assert_eq!(ty.is_numeric(), true);
Trait Implementations
sourceimpl Clone for UniversalIntegerType
impl Clone for UniversalIntegerType
sourcefn clone(&self) -> UniversalIntegerType
fn clone(&self) -> UniversalIntegerType
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for UniversalIntegerType
impl Debug for UniversalIntegerType
sourceimpl Display for UniversalIntegerType
impl Display for UniversalIntegerType
sourceimpl IntegerType for UniversalIntegerType
impl IntegerType for UniversalIntegerType
sourcefn range(&self) -> Option<&Range<BigInt>>
fn range(&self) -> Option<&Range<BigInt>>
The range of values this integer can assume. Read more
sourcefn is_universal(&self) -> bool
fn is_universal(&self) -> bool
Checks whether this is a universal integer type.
sourcefn is_equal(&self, other: &dyn IntegerType) -> bool
fn is_equal(&self, other: &dyn IntegerType) -> bool
Check if two integer types are equal.
sourcefn resolution_func(&self) -> Option<usize>
fn resolution_func(&self) -> Option<usize>
The resolution function associated with this type.
sourcefn as_basetype(&self) -> Option<&IntegerBasetype>
fn as_basetype(&self) -> Option<&IntegerBasetype>
Returns Some
if self is an IntegerBasetype
, None
otherwise.
sourcefn as_subtype(&self) -> Option<&IntegerSubtype<'_>>
fn as_subtype(&self) -> Option<&IntegerSubtype<'_>>
Returns Some
if self is an IntegerSubtype
, None
otherwise.
sourcefn unwrap_basetype(&self) -> &IntegerBasetype
fn unwrap_basetype(&self) -> &IntegerBasetype
Returns an &IntegerBasetype
or panics if the type is not a basetype.
sourcefn unwrap_subtype(&self) -> &IntegerSubtype<'_>
fn unwrap_subtype(&self) -> &IntegerSubtype<'_>
Returns an &IntegerSubtype
or panics if the type is not a subtype.
sourceimpl Type for UniversalIntegerType
impl Type for UniversalIntegerType
sourcefn is_discrete(&self) -> bool
fn is_discrete(&self) -> bool
Check if this is a discrete type. Read more
sourcefn is_numeric(&self) -> bool
fn is_numeric(&self) -> bool
Check if this is a numeric type. Read more
sourcefn is_composite(&self) -> bool
fn is_composite(&self) -> bool
Check if this is a composite type. Read more
sourcefn into_owned<'a>(self) -> OwnedType<'a> where
Self: 'a,
fn into_owned<'a>(self) -> OwnedType<'a> where
Self: 'a,
Convert into an owned type.
sourcefn 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.
impl Copy for UniversalIntegerType
Auto Trait Implementations
impl RefUnwindSafe for UniversalIntegerType
impl Send for UniversalIntegerType
impl Sync for UniversalIntegerType
impl Unpin for UniversalIntegerType
impl UnwindSafe for UniversalIntegerType
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