[−][src]Struct moore_vhdl::ty2::TypeDecl
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_vhdl::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");
Methods
impl<'t> TypeDecl<'t>
[src]
pub fn new<N: Into<TypeName>>(name: N, ty: &'t dyn Type) -> TypeDecl<'t>
[src]
Create a new type declaration from a name and a type.
pub fn name(&self) -> TypeName
[src]
Get the name of the declared type.
pub fn ty(&self) -> &'t dyn Type
[src]
Get the declared type.
Trait Implementations
impl<'t> Type for TypeDecl<'t>
[src]
fn is_scalar(&self) -> bool
[src]
fn is_discrete(&self) -> bool
[src]
fn is_numeric(&self) -> bool
[src]
fn is_composite(&self) -> bool
[src]
fn into_owned<'a>(self) -> OwnedType<'a> where
Self: 'a,
[src]
Self: 'a,
fn to_owned<'a>(&self) -> OwnedType<'a> where
Self: 'a,
[src]
Self: 'a,
fn as_any(&self) -> AnyType
[src]
fn is_equal(&self, other: &dyn Type) -> bool
[src]
fn is_implicitly_castable(&self, _into: &dyn Type) -> bool
[src]
impl<'t> Clone for TypeDecl<'t>
[src]
impl<'t> Copy for TypeDecl<'t>
[src]
impl<'t> Eq for TypeDecl<'t>
[src]
impl<'t> PartialEq<TypeDecl<'t>> for TypeDecl<'t>
[src]
impl<'t> Display for TypeDecl<'t>
[src]
impl<'t> Debug for TypeDecl<'t>
[src]
Auto Trait Implementations
impl<'t> !Send for TypeDecl<'t>
impl<'t> !Sync for TypeDecl<'t>
impl<'t> Unpin for TypeDecl<'t>
impl<'t> !UnwindSafe for TypeDecl<'t>
impl<'t> !RefUnwindSafe for TypeDecl<'t>
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,