Struct moore_vhdl::ty2::TypeDecl
source · [−]pub struct TypeDecl<'t> { /* private fields */ }
Expand description
A type declaration.
A TypeDecl
associates a name with a type. It is useful as a tracker of how
a type was called upon its definition, and where it was defined.
Examples
use moore_vhdl::ty2::{Type, TypeDecl, IntegerBasetype, Range};
use moore_common::name::get_name_table;
let ta = IntegerBasetype::new(Range::descending(31, 0));
let a = TypeDecl::new(
get_name_table().intern("DATA", false),
&ta,
);
assert_eq!(format!("{}", a), "type DATA is 31 downto 0");
Implementations
Trait Implementations
sourceimpl<'t> Type for TypeDecl<'t>
impl<'t> Type for TypeDecl<'t>
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<'t> Copy for TypeDecl<'t>
impl<'t> Eq for TypeDecl<'t>
impl<'t> StructuralEq for TypeDecl<'t>
impl<'t> StructuralPartialEq for TypeDecl<'t>
Auto Trait Implementations
impl<'t> !RefUnwindSafe for TypeDecl<'t>
impl<'t> !Send for TypeDecl<'t>
impl<'t> !Sync for TypeDecl<'t>
impl<'t> Unpin for TypeDecl<'t>
impl<'t> !UnwindSafe for TypeDecl<'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)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more