forked from mozilla/uniffi-rs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Added the `uniffi_core::metadata` module, which provides a system for building metadata buffers using const code. - Added the `FfiConverter::TYPE_ID_META` const, which holds metadata to identify the type. - Made the proc-macros generate use the new system to generate metadata consts, then export them using static variables. - Removed the current code to generate/store metadata based on the syn parsing. - Removed the type assertions and the requirement for a `uniffi_types` module. We don't need them now that we`re getting the type ids from the type itself. - Made the `FnMetadata.throws` field a Type rather than a String. - Calculate module paths with the `module_path!()` macro. This means we get accurate module paths without nightly. Changed mod_path to be a String, rather than a Vec since this is what `module_path!()` outputs. - Added code to strip the `r#` part out of raw idents before serializing it into the metadata. - Replaced the `collect_params()` function with the `ScaffoldingBits` struct. There was too much complexity for a single function -- for example unzip() only works with pairs, not 3-tuples. In general, the new metadata system is more reliable doing everything in the proc-macros. Proc-macros can only see the type identifiers, but they don't anything about the underlying type, since users can rename types with type aliases. It's also simpler since you don't have to walk the AST so much. One TODO is getting checksum working again. One limitation of the const code is that we can't use it to generate function identifiers.
- Loading branch information
Showing
48 changed files
with
1,776 additions
and
860 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
[package] | ||
name = "uniffi_fixture_metadata" | ||
version = "0.1.0" | ||
authors = ["Firefox Sync Team <sync-team@mozilla.com>"] | ||
edition = "2021" | ||
license = "MPL-2.0" | ||
publish = false | ||
|
||
[lib] | ||
name = "uniffi_fixture_metadata" | ||
|
||
[dependencies] | ||
uniffi = { path = "../../uniffi" } | ||
uniffi_meta = { path = "../../uniffi_meta" } | ||
uniffi_core = { path = "../../uniffi_core" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
|
||
/// This entire crate is just a set of tests for metadata handling. We use a separate crate | ||
/// for testing because the metadata handling is split up between several crates, and no crate | ||
/// on all the functionality. | ||
#[cfg(test)] | ||
mod tests; | ||
|
||
pub struct UniFfiTag; |
Oops, something went wrong.