Enum witnext::BuiltinType[][src]

pub enum BuiltinType {
    Char,
    U8 {
        lang_c_char: bool,
    },
    U16,
    U32 {
        lang_ptr_size: bool,
    },
    U64,
    S8,
    S16,
    S32,
    S64,
    F32,
    F64,
}

Variants

Char

This is a 32-bit unicode scalar value, not a code point.

Same as the Rust language’s char type.

U8

An 8-bit unsigned integer.

Show fields

Fields of U8

lang_c_char: bool

Indicates whether this type is intended to represent the char type in the C language. The C char type is often unsigned, but it’s language-specific. At an interface-types level this is an unsigned byte but binding generators may wish to bind this as the language-specific representation for a C character instead.

This is also currently used exclusively in conjunction with @witx pointer to hint that it’s pointing to unicode string data as well.

U16

A 16-bit unsigned integer.

U32

A 32-bit unsigned integer.

Show fields

Fields of U32

lang_ptr_size: bool

Indicates that this 32-bit value should actually be considered a pointer-like value in language bindings. At the interface types layer this is always a 32-bit unsigned value, but binding generators may wish to instead bind this as the equivalent of C’s size_t for convenience with other APIs.

This allows witx authors to communicate the intent that the argument or return-value is pointer-like.

U64

A 64-bit unsigned integer.

S8

An 8-bit signed integer

S16

A 16-bit signed integer

S32

A 32-bit signed integer

S64

A 64-bit signed integer

F32

A 32-bit floating point value.

F64

A 64-bit floating point value.

Implementations

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

Attempts to parse Self from parser, returning an error if it could not be parsed. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Tests to see whether this token is the first token within the Cursor specified. Read more

Returns a human-readable name of this token to display when generating errors about this token missing. Read more

The same as peek, except it checks the token immediately following the current token. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.