[][src]Struct moore_vhdl::ty2::TypeDecl

pub struct TypeDecl<'t> { /* fields omitted */ }

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

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> Clone for TypeDecl<'t>[src]

impl<'t> Copy for TypeDecl<'t>[src]

impl<'t> Debug for TypeDecl<'t>[src]

impl<'t> Display for TypeDecl<'t>[src]

impl<'t> Eq for TypeDecl<'t>[src]

impl<'t> PartialEq<TypeDecl<'t>> for TypeDecl<'t>[src]

impl<'t> StructuralEq for TypeDecl<'t>[src]

impl<'t> StructuralPartialEq for TypeDecl<'t>[src]

impl<'t> Type for TypeDecl<'t>[src]

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.