Modules
FfiDefault trait
Callback interfaces are traits specified in UDL which can be implemented by foreign languages.
Low-level support for calling rust functions
Structs
Support for reading a slice of foreign-language-allocated bytes over the FFI.
Struct to hold a foreign callback.
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
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
Wrap a rust function call and return the result directly
Wrap a rust function call that returns a
Result<_, RustBuffer>
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 calling uniffi_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
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.