[][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_common::name::get_name_table;

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

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

Implementations

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

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

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

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

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

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

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

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

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

Auto Trait Implementations

impl<'t> !RefUnwindSafe for TypeMark<'t>[src]

impl<'t> !Send for TypeMark<'t>[src]

impl<'t> !Sync for TypeMark<'t>[src]

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

impl<'t> !UnwindSafe for TypeMark<'t>[src]

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> Pointable for T

type Init = T

The type for initializers.

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.