Module uniffi_bindgen::interface::types[][src]

Basic typesystem for defining a component interface.

This module provides the “API-level” typesystem of a UniFFI Rust Component, that is, the types provided by the Rust implementation and consumed callers of the foreign language bindings. Think “objects” and “enums” and “records”.

The Type enum represents high-level types that would appear in the public API of a component, such as enums and records as well as primitives like ints and strings. The Rust code that implements a component, and the foreign language bindings that consume it, will both typically deal with such types as their core concern.

The set of all Types used in a component interface is represented by a [TypeUniverse], which can be used by the bindings generator code to determine what type-related helper functions to emit for a given component.

As a developer working on UniFFI itself, you’re likely to spend a fair bit of time thinking about how these API-level types map into the lower-level types of the FFI layer as represented by the [ffi::FFIType] enum, but that’s a detail that is invisible to end users.

Enums

Type

Represents all the different high-level types that can be used in a component interface. At this level we identify user-defined types by name, without knowing any details of their internal structure apart from what type of thing they are (record, enum, etc).