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 generate and include component scaffolding.
- 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.
- Struct to hold a foreign callback.
- Schedule Rust calls using a foreign executor
- Opaque handle for a foreign task executor.
- Support for passing an allocated-by-Rust buffer of bytes over the FFI.
- Represents the success/error of a rust call
- Opaque handle for a Rust future that’s stored by the foreign language code
- Used when internal/unexpected error happened when calling a foreign callback, for example when a unknown exception is raised
Enums
- Result of a foreign callback invocation
- Result code returned by
ForeignExecutorCallback
- Result of a FFI call to a Rust function
- Result code for rust_future_poll. This is passed to the continuation function.
- Passed to a
RustTaskCallback
function when the executor invokes them.
Constants
- The method index used by the Drop trait to communicate to the foreign language side that Rust has finished with it, and it can be deleted from the handle map.
Traits
- Generalized FFI conversions
- FfiConverter for Arc-types
- 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.
- Set the global ForeignExecutorCallback. This is called by the foreign bindings, normally during initialization.
- 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 RustFutureHandle
- Poll a Rust future
Type Definitions
- ForeignCallback is the Rust representation of a foreign language function. It is the basis for all callbacks interfaces. It is registered exactly once per callback interface, at library start up time. Calling this method is only done by generated objects which mirror callback interfaces objects in the foreign language.
- Callback to schedule a Rust call with a
ForeignExecutor
. The bindings code registers exactly one of these with the Rust code. Result<T, Error>
- Foreign callback that’s passed to rust_future_poll
- Callback for a Rust task, this is what the foreign executor invokes
Attribute Macros
- A dummy macro that does nothing.