Enum witnext::Type[][src]

pub enum Type {
    Record(RecordDatatype),
    Variant(Variant),
    Handle(HandleDatatype),
    List(TypeRef),
    Pointer(TypeRef),
    ConstPointer(TypeRef),
    Buffer(Buffer),
    Builtin(BuiltinType),
}

Structure of all possible interface types.

Note that this is intended to match the interface types proposal itself. Currently this is relatively close to that with just a few *.witx extensions for now.

Variants

A structure with named field.

Variant(Variant)

An enumeration where a value is one of a number of variants.

A “handle” which is an un-forgeable reference. Today this is an i32 where a module can’t forge and use integers it was not already given access to.

List(TypeRef)

A list of a type, stored in linear memory.

Note that lists of char are specialized to indicate strings.

Pointer(TypeRef)

A witx-specific type representing a raw mutable pointer into linear memory

ConstPointer(TypeRef)

A witx-specific type representing a raw const pointer into linear memory

Buffer(Buffer)

A buffer type representing a window in memory

Builtin(BuiltinType)

A builtin base-case type.

Implementations

impl Type[src]

pub fn kind(&self) -> &'static str[src]

Returns a human-readable string to describe this type.

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

Returns whether the in-memory representation of this type will always be valid regardless of the value of all the bits in memory.

This is only true for numerical types, pointers, and records of these values. This is used for canonical lifting/lowering of lists.

pub fn type_equal(&self, other: &Type) -> bool[src]

Trait Implementations

impl Clone for Type[src]

impl Debug for Type[src]

impl Eq for Type[src]

impl Hash for Type[src]

impl Layout for Type[src]

impl PartialEq<Type> for Type[src]

impl StructuralEq for Type[src]

impl StructuralPartialEq for Type[src]

Auto Trait Implementations

impl !RefUnwindSafe for Type

impl !Send for Type

impl !Sync for Type

impl Unpin for Type

impl !UnwindSafe for Type

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, 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.