[][src]Struct moore_vhdl::ty2::TypeMark

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

A type mark.

A TypeMark associates a name with a type or subtype, but in a different manner than TypeDecl and SubtypeDecl. It is useful as a tracker of how a type was referred to in the source code. A TypeMark represents a way of naming a type that is familiar to the user and can be presented as is in a diagnostic message.

Examples

use moore_vhdl::ty2::{Type, TypeMark, NullType};
use moore_vhdl::common::name::get_name_table;

let ta = NullType;
let a = TypeMark::new(
    get_name_table().intern("DATA", false),
    &ta,
);

assert_eq!(format!("{}", a), "DATA");

Methods

impl<'t> TypeMark<'t>
[src]

pub fn new<N: Into<TypeName>>(name: N, ty: &'t dyn Type) -> TypeMark<'t>
[src]

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

pub fn name(&self) -> TypeName
[src]

Get the name of the mark.

pub fn ty(&self) -> &'t dyn Type
[src]

Get the type of the mark.

Trait Implementations

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

fn is_equal(&self, other: &dyn Type) -> bool
[src]

Check if two types are equal.

fn is_implicitly_castable(&self, _into: &dyn Type) -> bool
[src]

Check if the type can be implicitly cast to another.

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

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

impl<'t> Clone for TypeMark<'t>
[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

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

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

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

Auto Trait Implementations

impl<'t> !Send for TypeMark<'t>

impl<'t> !Sync for TypeMark<'t>

Blanket Implementations

impl<T> From for T
[src]

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

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

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

type Owned = T

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

type Error = !

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

The type returned in the event of a conversion error.

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

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

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

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

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

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

The type returned in the event of a conversion error.