Docstrings rarely have unicode characters so these are not adding much
value. They present an issue for the downstream moz-central crate
(https://bugzilla.mozilla.org/show_bug.cgi?id=1894888), so let's remove
them.
This causes the version selector to be rendered into the pages,
however they will not be shown until we actually deploy
version information.
Includes a script to help generate redirects for all our "old" pages.
The generation of these docs generates a lot of churn in the gh-pages
branch - even when nothing has changed - so instead we skip building
and publishing them and link to the generated pages on docs.rs.
When a `#[derive(uniffi::Error)]` didn't appear in any function signatures,
the FfiConverter for the item was written to assume an error, but the
bindings FfiConverter treated the item as a plain-old Enum. This caused
runtime errors when trying to unpack the rustbuffers due to the
disagreement about the buffer format.
As part of fixing this, the `Option<bool>` to try and represent the
flatness of Enums/Errors was replaced with an `EnumShape` enum to
make these states clearer and so the ComponentInterface can better
understand the layout.
Fixes#2108
Always use `_uniffi`, `_Uniffi`, or `_UNIFFI` for module-level names.
The leading underscore is to indicate private variables and makes it so
the names don't appear in autocomplete. I think this is the most
Pythonic naming style.
Use `_uniffi` rather than simply `_` to avoid name collisions. I think
the general contract with our users should be that we own the `uniffi`
prefix. If they want to name something `UniffiFoo`, then they take the
risk of a name collision.
This is a breaking change for BindingGenerators, and follows up on
other breaking changes made for this release (#2078). Between them,
it is intended to offer a better framework for binding generators
for future versions and break unintentional coupling between
uniffi_bindgen and the builtin bindings.
This patch updates the `BindingGenerator` trait to give binding generators
more control over the binding generation process and to simplify the
interactions between the generator and `uniffi_bindgen`.
The trait `BindingsConfig` has been removed and replaced with a new
method on `BindingGenerator` which passes the generator the entire
list of all `ComponentInterface` and `Config` objects to be used in the
generation, which the generator can modify as necessary. The binding
generator is also passed the entire list of items to generate rather
than called once per item - this gives the generator more flexibility
in how the items are generated.
A new `Component` struct has been introduced which holds all necessary
information for a single crate/namespace, including the `ComponentInterface`
and `Config`. These structs are passed to the `BindingGenerator`
A new `GenerationSettings` struct is defined to pass options to the generators.
* Prefix newly added globals in Python with underscores
* Python: Don't glob-import `uniffi_set_event_loop`
This name is internal to uniffi, it should be explicitly named using
`library.uniffi_set_event_loop`. Note this in the docs.
Followup of #1599.