[][src]Enum moore_vhdl::ty2::TypeName

pub enum TypeName {
    Name(Name),
    Span(Span),
}

A type name.

Types can be declared by the user or be provided as a builtin. In the case of a user-defined type we would like to keep track of its Span for good error messages. Builtin types have no location we can refer to however, and we must rather keep track of the name directly.

Variants

Name(Name)

The name is defined through an internalized name.

Span(Span)

The name is defined through a span.

Implementations

impl TypeName[src]

pub fn to_string(self) -> String[src]

Get the type name as a string.

pub fn as_name(self) -> Option<Name>[src]

Get the type name as a Name.

Returns None if the type name is given through a Span.

pub fn as_span(self) -> Option<Span>[src]

Get the type name as a Span.

Returns None if the type name is given as a Name.

Trait Implementations

impl Clone for TypeName[src]

impl Copy for TypeName[src]

impl Debug for TypeName[src]

impl Display for TypeName[src]

impl Eq for TypeName[src]

impl From<Name> for TypeName[src]

impl From<Span> for TypeName[src]

impl Hash for TypeName[src]

impl PartialEq<TypeName> for TypeName[src]

impl StructuralEq for TypeName[src]

impl StructuralPartialEq for TypeName[src]

Auto Trait Implementations

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.