Modules
- Types that can cross the FFI boundary.
- Pack UniFFI interface metadata into byte arrays
Macros
- Assert that the uniffi runtime version matches an expected value.
- A macro to build testcases for a component’s generated bindings.
- Generate the
FfiConverter
and theUniffiCustomTypeConverter
implementations for a Custom Type - ie, for a<T>
which implementsUniffiCustomTypeConverter
via the newtype idiom. - Generate the
FfiConverter
implementation for a Custom Type - ie, for a<T>
which implementsUniffiCustomTypeConverter
. - Derive FFI traits
- Macro to implement
FfiConverterArc<T>
for a UniFfiTag using a different UniFfiTag - Macro to implement
FfiConverter<T>
for a UniFfiTag using a different UniFfiTag - Macro to implement lowering/lifting using a
RustBuffer
- A helper macro to include generated component scaffolding.
- Top-level initialization macro
Structs
- Support for reading a slice of foreign-language-allocated bytes over the FFI.
- Perform a call to a foreign async method C struct that represents the foreign future.
- C struct that represents the result of a foreign future
- Object handle
- Support for passing an allocated-by-Rust buffer of bytes over the FFI.
- Represents the success/error of a rust call
- Used when internal/unexpected error happened when calling a foreign callback, for example when a unknown exception is raised
Enums
- Result of a FFI call to a Rust function
- Result code for rust_future_poll. This is passed to the continuation function.
Traits
- Generalized FFI conversions
- FfiConverter for Arc-types
- Manage handles for
Arc<Self>
instances - Lift values passed by the foreign code over the FFI into Rust values
- Lift references
- Return foreign values to Rust
- Lower Rust values to pass them to the foreign code
- Return Rust values to the foreign code
Functions
- Check whether the uniffi runtime version is compatible a given uniffi_bindgen version.
- A helper function to ensure we don’t read past the end of a buffer.
- Handle a scaffolding calls
- Cancel a Rust future
- Complete a Rust future
- Free a Rust future, dropping the strong reference and releasing all references held by the future.
- Create a new Handle for a Rust future
- Poll a Rust future
- This helper allocates a new byte buffer owned by the Rust code, and returns it to the foreign-language code as a
RustBuffer
struct. Callers must eventually free the resulting buffer, either by explicitly callinguniffi_rustbuffer_free
defined below, or by passing ownership of the buffer back into Rust code. - Free a byte buffer that had previously been passed to the foreign language code.
- This helper copies bytes owned by the foreign-language code into a new byte buffer owned by the Rust code, and returns it as a
RustBuffer
struct. Callers must eventually free the resulting buffer, either by explicitly calling the destructor defined below, or by passing ownership of the buffer back into Rust code. - Reserve additional capacity in a byte buffer that had previously been passed to the foreign language code.
Type Definitions
- Callback that’s passed to a foreign async functions.
- Handle for a callback data associated with a foreign future.
- Handle for a foreign future
Result<T, Error>
- Foreign callback that’s passed to rust_future_poll
Attribute Macros
- An attribute for constructors.
- An attribute for methods.