Crate uniffi

Source

Modules§

deps
Reexport items from other uniffi creates
ffi
Reexport items from other uniffi creates Types that can cross the FFI boundary.
metadata
Reexport items from other uniffi creates Pack UniFFI interface metadata into byte arrays

Macros§

assert_compatible_version
Reexport items from other uniffi creates Assert that the uniffi runtime version matches an expected value.
build_foreign_language_testcases
A macro to build testcases for a component’s generated bindings.
custom_newtype
Generate FFI code for a custom newtype
custom_type
Generate FFI code for a custom type
derive_ffi_traits
Reexport items from other uniffi creates Derive FFI traits
ffi_converter_rust_buffer_lift_and_lower
Reexport items from other uniffi creates Macro to implement lowering/lifting using a RustBuffer
include_scaffolding
A helper macro to include generated component scaffolding.
setup_scaffolding
Top-level initialization macro
trace
Reexport items from other uniffi creates
use_remote_type
Use the FFI trait implementations defined in another crate for a remote type

Structs§

ForeignBytes
Reexport items from other uniffi creates Support for reading a slice of foreign-language-allocated bytes over the FFI.
ForeignFuture
Reexport items from other uniffi creates C struct that represents a foreign future, used to perform a call to a foreign async method.
ForeignFutureResult
Reexport items from other uniffi creates C struct that represents the result of a foreign future
Handle
Reexport items from other uniffi creates Object handle
LiftArgsError
Reexport items from other uniffi creates Error when trying to lift arguments to pass to the scaffolding call
MetadataBuffer
Reexport items from other uniffi creates
RustBuffer
Reexport items from other uniffi creates Support for passing an allocated-by-Rust buffer of bytes over the FFI.
RustCallStatus
Reexport items from other uniffi creates Represents the success/error of a rust call
UnexpectedUniFFICallbackError
Reexport items from other uniffi creates Used when internal/unexpected error happened when calling a foreign callback, for example when a unknown exception is raised

Enums§

RustCallError
Reexport items from other uniffi creates Error type for Rust scaffolding calls
RustCallStatusCode
Reexport items from other uniffi creates Result of a FFI call to a Rust function Value is signed to avoid Kotlin’s experimental unsigned types.
RustFuturePoll
Reexport items from other uniffi creates Result code for rust_future_poll. This is passed to the continuation function.

Traits§

ConvertError
Reexport items from other uniffi creates
FfiConverter
Reexport items from other uniffi creates Generalized FFI conversions
FfiConverterArc
Reexport items from other uniffi creates FfiConverter for Arc-types
FfiDefault
Reexport items from other uniffi creates
HandleAlloc
Reexport items from other uniffi creates Manage handles for Arc<Self> instances
Lift
Reexport items from other uniffi creates Lift values passed by the foreign code over the FFI into Rust values
LiftRef
Reexport items from other uniffi creates Lift references
LiftReturn
Reexport items from other uniffi creates Return foreign values to Rust
Lower
Reexport items from other uniffi creates Lower Rust values to pass them to the foreign code
LowerError
Reexport items from other uniffi creates Return Rust error values
LowerReturn
Reexport items from other uniffi creates Return Rust values to the foreign code
TypeId
Reexport items from other uniffi creates Type ID metadata

Functions§

check_compatible_version
Reexport items from other uniffi creates Check whether the uniffi runtime version is compatible a given uniffi_bindgen version.
check_remaining
Reexport items from other uniffi creates A helper function to ensure we don’t read past the end of a buffer.
checksum_metadata
Reexport items from other uniffi creates
foreign_async_call
Reexport items from other uniffi creates
foreign_future_complete
Reexport items from other uniffi creates
rust_call
Reexport items from other uniffi creates Handle a scaffolding calls
rust_future_cancel
Reexport items from other uniffi creates Cancel a Rust future
rust_future_complete
Reexport items from other uniffi creates Complete a Rust future
rust_future_free
Reexport items from other uniffi creates Free a Rust future, dropping the strong reference and releasing all references held by the future.
rust_future_new
Reexport items from other uniffi creates Create a new Handle for a Rust future
rust_future_poll
Reexport items from other uniffi creates Poll a Rust future
uniffi_rustbuffer_alloc
Reexport items from other uniffi creates 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.
uniffi_rustbuffer_free
Reexport items from other uniffi creates Free a byte buffer that had previously been passed to the foreign language code.
uniffi_rustbuffer_from_bytes
Reexport items from other uniffi creates 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.
uniffi_rustbuffer_reserve
Reexport items from other uniffi creates Reserve additional capacity in a byte buffer that had previously been passed to the foreign language code.

Type Aliases§

ForeignFutureCallback
Reexport items from other uniffi creates Callback that’s passed to a foreign async functions.
ForeignFutureCallbackData
Reexport items from other uniffi creates Handle for a callback data associated with a foreign future.
ForeignFutureHandle
Reexport items from other uniffi creates Handle for a foreign future
Result
Reexport items from other uniffi creates Result<T, Error>
RustFutureContinuationCallback
Reexport items from other uniffi creates Foreign callback that’s passed to rust_future_poll

Attribute Macros§

constructor
An attribute for constructors.
export
method
An attribute for methods.

Derive Macros§

Enum
Error
Object
Record