[][src]Enum moore_svlog::ty::TypeKind

pub enum TypeKind<'t> {
    Error,
    Void,
    Time,
    Bit(Domain),
    Int(usizeDomain),
    Named(Spanned<Name>, NodeIdType<'t>),
    Struct(NodeId),
    PackedArray(usizeType<'t>),
    BitScalar {
        domain: Domain,
        sign: Sign,
    },
    BitVector {
        domain: Domain,
        sign: Sign,
        range: Range,
        dubbed: bool,
    },
}

Type data.

Variants

Error

An error occurred during type computation.

Void

The void type.

Time

The time type.

Bit(Domain)

A single bit type.

Int(usizeDomain)

An integer type.

Named(Spanned<Name>, NodeIdType<'t>)

A named type.

The first field represents how the type was originally named by the user. The second field represents the binding of the resolved name. The third field represents the actual type.

Struct(NodeId)

A struct type.

PackedArray(usizeType<'t>)

A packed array type.

BitScalar

A single bit type.

Fields of BitScalar

domain: Domainsign: Sign
BitVector

A simple bit vector type (SBVT).

The innermost dimension of a multi-dimensional bit vector type is always represented as a SBVT.

Fields of BitVector

domain: Domainsign: Signrange: Rangedubbed: bool

Methods

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

pub fn is_error(&self) -> bool[src]

Check if this is the error type.

pub fn is_void(&self) -> bool[src]

Check if this is the void type.

pub fn is_struct(&self) -> bool[src]

Check if this is a struct type.

pub fn is_array(&self) -> bool[src]

Check if this is an array type.

pub fn get_struct_def(&self) -> Option<NodeId>[src]

Get the definition of a struct.

pub fn get_array_element(&self) -> Option<Type<'t>>[src]

Get the element type of an array.

pub fn get_array_length(&self) -> Option<usize>[src]

Get the length of an array.

pub fn width(&self) -> usize[src]

Get the width of the type.

Panics if the type is not an integer.

pub fn is_bit_vector(&self) -> bool[src]

Check if this is a bit vector type.

pub fn is_bit_scalar(&self) -> bool[src]

Check if this is a bit scalar type.

pub fn resolve_name(&'t self) -> Type<'t>[src]

Remove all typedefs and reveal the concrete fundamental type.

pub fn get_value_domain(&self) -> Option<Domain>[src]

Return the domain of the type, if it has one.

pub fn get_sign(&self) -> Option<Sign>[src]

Return the sign of the type, if it has one.

pub fn is_unsigned(&self) -> bool[src]

Check whether the type is unsigned.

Returns false for types which have no sign.

pub fn is_signed(&self) -> bool[src]

Check whether the type is signed.

Returns false for types which have no sign.

pub fn change_sign<'gcx>(
    &'gcx self,
    cx: &impl Context<'gcx>,
    sign: Sign
) -> Type<'gcx>
[src]

Change the sign of a simple bit type.

Trait Implementations

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

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

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

impl<'a> From<&'a TypeKind<'a>> for TypeContext<'a>[src]

impl<'t> Hash for TypeKind<'t>[src]

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

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

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

Auto Trait Implementations

impl<'t> RefUnwindSafe for TypeKind<'t>

impl<'t> Send for TypeKind<'t>

impl<'t> Sync for TypeKind<'t>

impl<'t> Unpin for TypeKind<'t>

impl<'t> UnwindSafe for TypeKind<'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<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

impl<T> Erased for T

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

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

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.