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

Create a new type declaration from a name and a type.

Get the name of the declared type.

Get the declared type.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Check if this is a scalar type. Read more

Check if this is a discrete type. Read more

Check if this is a numeric type. Read more

Check if this is a composite type. Read more

Convert into an owned type.

Clone this type.

Converts from &Type to AnyType.

Check if two types are equal.

Check if the type can be implicitly cast to another.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.