[][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

Implementations

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 is_dubbed(&self) -> bool[src]

Check if this type uses a predefined type alias as name.

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

Check if this type is a valid boolean.

pub fn resolve_name(&self) -> &Self[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 get_range(&self) -> Option<Range>[src]

Return the range 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_value_domain<'gcx>(
    &'gcx self,
    cx: &impl Context<'gcx>,
    domain: Domain
) -> Type<'gcx>
[src]

Change the value domain of a type.

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

Change the sign of a simple bit type.

pub fn change_range<'gcx>(
    &'gcx self,
    cx: &impl Context<'gcx>,
    range: Range
) -> Type<'gcx>
[src]

Change the range of a simple bit type.

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

Check if this type has a simple bit vector equivalent.

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

Check if this type is a simple bit vector type.

pub fn get_simple_bit_vector<'gcx>(
    &'gcx self,
    cx: &impl Context<'gcx>,
    env: ParamEnv,
    force_vector: bool
) -> Option<Type<'gcx>>
[src]

Try to convert to an equivalent simple bit vector type.

All integral data types have an equivalent simple bit vector type. These include the following:

  • all basic integers
  • packed arrays
  • packed structures
  • packed unions
  • enums
  • time (excluded in this implementation)

If force_vector is true, the returned type has range [0:0] if it would otherwise be a single bit.

pub fn try_bit_size<'gcx>(
    &'gcx self,
    cx: &impl Context<'gcx>,
    env: ParamEnv
) -> Result<usize>
[src]

Compute the size of the type in bits.

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<'a> From<&'a TypeKind<'a>> for CastType<'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.