Expand description
Reexport items from other uniffi creates Types that can cross the FFI boundary.
Modules
- Callback interfaces are traits specified in UDL which can be implemented by foreign languages.
- FfiDefault trait
- This module contains code to handle foreign callbacks - C-ABI functions that are defined by a foreign language, then registered with UniFFI. These callbacks are used to implement callback interfaces, async scheduling etc. Foreign callbacks are registered at startup, when the foreign code loads the exported library. For each callback type, we also define a “cell” type for storing the callback.
- Schedule tasks using a foreign executor.
- Low-level support for calling rust functions
- [
RustFuture
] represents aFuture
that can be sent to the foreign code over FFI.
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
Functions
- 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 Aliases
- 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. - Foreign callback that’s passed to rust_future_poll
- Callback for a Rust task, this is what the foreign executor invokes