-
Notifications
You must be signed in to change notification settings - Fork 38
Open
Labels
help wantedExtra attention is neededExtra attention is needed
Description
This is a tracking issue. Many issues should be created and fixed in their own separate PRs.
Before we do this, we should do a final 0.29.x release.
Here is the changelog for uniffi-rs:
- Enums and Records support exporting uniffi traits (ie, Display, Hash, Eq etc) Support "standard rust traits" for enums and records? mozilla/uniffi-rs#2555
- Support for exporting the Ord trait, allowing objects to be ordered by Rust Allow objects to export the
Ordtrait. mozilla/uniffi-rs#2583. - #[uniffi(default)] literals are now optional - eg, #[uniffi(default)] and #[uniffi(default = 0)] are equivalent. Similarly for args; #[uniffi::export(default(arg_name))]. When no literal is specifed, named types (objects, records, etc) can be used as long as they have suitable default values. Proc-macros allow default values without needing to specify a literal. mozilla/uniffi-rs#2543. Custom types too Support default value for custom type mozilla/uniffi-rs#2603
- Custom enum and object types can be used as error type Support
Type::Custom{ builtin: Enum|Object, .. }as throws type mozilla/uniffi-rs#2658 - Objects can implement external traits Can't declare an object implements a trait which is defined externally. mozilla/uniffi-rs#2430
Breaking changes
- uniffi_bindgen::backend has been removed.
- #[uniffi(default)] changes how defaults are represented.
- FfiType::RustArcPtr has been removed and the FFI type for objects/interfaces is now a u64. Bindings authors will need to update their code to reflect this:
- Lowering/lifting now uses u64 values
- The free function inputs a u64 handle rather than a raw pointer
- The clone function inputs and returns a u64 handle rather than a raw pointer
- Enums and Records can have methods, so the Method now carries self_type instead of the object name. In the templates, for Callable.takes_self() is replaced with Callable.self_type().
- Trait / Callback interface changes
- VTable fields are now: free, clone, followed by a field for each interface method. Note That free is now at the start of the vtable rather than the end.
- Trait interface changes:
- Foreign handles must always have the lowest bit set
- Both Rust and foreign handles can now be passed across the FFI. When Lifting/lowering trait interface handles, check if the handle was generated from Rust or the foreign side.
- See https://github.com/mozilla/uniffi-rs/pulls/2586 examples of how the builtin bindings here changed.
- Trait interface changes:
Metadata
Metadata
Assignees
Labels
help wantedExtra attention is neededExtra attention is needed