Module uniffi::ffi

source ·
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 a Future that can be sent to the foreign code over FFI.

Structs

Enums

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

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