Bug 1921280 - Vendor in the latest app-services commit, r=adw,urlbar-reviewers

This brought in a breaking change: `Suggestion.icon` is now the `bytes`
type.  To accomidate that, added UniFFI support for bytes and updated
the SuggestBackendRust code since that field is now a Uint8Array on the
JS side.

Differential Revision: https://phabricator.services.mozilla.com/D223774
This commit is contained in:
Ben Dean-Kawamura
2024-09-30 14:07:55 +00:00
parent a295cf01ba
commit 16ea6863b4
58 changed files with 1267 additions and 1095 deletions

View File

@@ -60,9 +60,9 @@ git = "https://github.com/mozilla-spidermonkey/jsparagus"
rev = "61f399c53a641ebd3077c1f39f054f6d396a633c"
replace-with = "vendored-sources"
[source."git+https://github.com/mozilla/application-services?rev=5af28e120fd636135d50894cf16a74e21dc63045"]
[source."git+https://github.com/mozilla/application-services?rev=b10c1319e74041b2777e07657fc83dc879f841f4"]
git = "https://github.com/mozilla/application-services"
rev = "5af28e120fd636135d50894cf16a74e21dc63045"
rev = "b10c1319e74041b2777e07657fc83dc879f841f4"
replace-with = "vendored-sources"
[source."git+https://github.com/mozilla/audioipc?rev=e6f44a2bd1e57d11dfc737632a9e849077632330"]

30
Cargo.lock generated
View File

@@ -1763,7 +1763,7 @@ dependencies = [
[[package]]
name = "error-support"
version = "0.1.0"
source = "git+https://github.com/mozilla/application-services?rev=5af28e120fd636135d50894cf16a74e21dc63045#5af28e120fd636135d50894cf16a74e21dc63045"
source = "git+https://github.com/mozilla/application-services?rev=b10c1319e74041b2777e07657fc83dc879f841f4#b10c1319e74041b2777e07657fc83dc879f841f4"
dependencies = [
"error-support-macros",
"lazy_static",
@@ -1775,7 +1775,7 @@ dependencies = [
[[package]]
name = "error-support-macros"
version = "0.1.0"
source = "git+https://github.com/mozilla/application-services?rev=5af28e120fd636135d50894cf16a74e21dc63045#5af28e120fd636135d50894cf16a74e21dc63045"
source = "git+https://github.com/mozilla/application-services?rev=b10c1319e74041b2777e07657fc83dc879f841f4#b10c1319e74041b2777e07657fc83dc879f841f4"
dependencies = [
"proc-macro2",
"quote",
@@ -3137,7 +3137,7 @@ dependencies = [
[[package]]
name = "interrupt-support"
version = "0.1.0"
source = "git+https://github.com/mozilla/application-services?rev=5af28e120fd636135d50894cf16a74e21dc63045#5af28e120fd636135d50894cf16a74e21dc63045"
source = "git+https://github.com/mozilla/application-services?rev=b10c1319e74041b2777e07657fc83dc879f841f4#b10c1319e74041b2777e07657fc83dc879f841f4"
dependencies = [
"lazy_static",
"parking_lot",
@@ -4433,7 +4433,7 @@ dependencies = [
[[package]]
name = "nss_build_common"
version = "0.1.0"
source = "git+https://github.com/mozilla/application-services?rev=5af28e120fd636135d50894cf16a74e21dc63045#5af28e120fd636135d50894cf16a74e21dc63045"
source = "git+https://github.com/mozilla/application-services?rev=b10c1319e74041b2777e07657fc83dc879f841f4#b10c1319e74041b2777e07657fc83dc879f841f4"
[[package]]
name = "nsstring"
@@ -4646,7 +4646,7 @@ checksum = "d01a5bd0424d00070b0098dd17ebca6f961a959dead1dbcbbbc1d1cd8d3deeba"
[[package]]
name = "payload-support"
version = "0.1.0"
source = "git+https://github.com/mozilla/application-services?rev=5af28e120fd636135d50894cf16a74e21dc63045#5af28e120fd636135d50894cf16a74e21dc63045"
source = "git+https://github.com/mozilla/application-services?rev=b10c1319e74041b2777e07657fc83dc879f841f4#b10c1319e74041b2777e07657fc83dc879f841f4"
dependencies = [
"serde",
"serde_derive",
@@ -5131,7 +5131,7 @@ checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da"
[[package]]
name = "relevancy"
version = "0.1.0"
source = "git+https://github.com/mozilla/application-services?rev=5af28e120fd636135d50894cf16a74e21dc63045#5af28e120fd636135d50894cf16a74e21dc63045"
source = "git+https://github.com/mozilla/application-services?rev=b10c1319e74041b2777e07657fc83dc879f841f4#b10c1319e74041b2777e07657fc83dc879f841f4"
dependencies = [
"anyhow",
"base64 0.21.3",
@@ -5154,7 +5154,7 @@ dependencies = [
[[package]]
name = "remote_settings"
version = "0.1.0"
source = "git+https://github.com/mozilla/application-services?rev=5af28e120fd636135d50894cf16a74e21dc63045#5af28e120fd636135d50894cf16a74e21dc63045"
source = "git+https://github.com/mozilla/application-services?rev=b10c1319e74041b2777e07657fc83dc879f841f4#b10c1319e74041b2777e07657fc83dc879f841f4"
dependencies = [
"log",
"parking_lot",
@@ -5719,7 +5719,7 @@ dependencies = [
[[package]]
name = "sql-support"
version = "0.1.0"
source = "git+https://github.com/mozilla/application-services?rev=5af28e120fd636135d50894cf16a74e21dc63045#5af28e120fd636135d50894cf16a74e21dc63045"
source = "git+https://github.com/mozilla/application-services?rev=b10c1319e74041b2777e07657fc83dc879f841f4#b10c1319e74041b2777e07657fc83dc879f841f4"
dependencies = [
"ffi-support",
"interrupt-support",
@@ -5899,7 +5899,7 @@ checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc"
[[package]]
name = "suggest"
version = "0.1.0"
source = "git+https://github.com/mozilla/application-services?rev=5af28e120fd636135d50894cf16a74e21dc63045#5af28e120fd636135d50894cf16a74e21dc63045"
source = "git+https://github.com/mozilla/application-services?rev=b10c1319e74041b2777e07657fc83dc879f841f4#b10c1319e74041b2777e07657fc83dc879f841f4"
dependencies = [
"anyhow",
"chrono",
@@ -5951,7 +5951,7 @@ dependencies = [
[[package]]
name = "sync-guid"
version = "0.1.0"
source = "git+https://github.com/mozilla/application-services?rev=5af28e120fd636135d50894cf16a74e21dc63045#5af28e120fd636135d50894cf16a74e21dc63045"
source = "git+https://github.com/mozilla/application-services?rev=b10c1319e74041b2777e07657fc83dc879f841f4#b10c1319e74041b2777e07657fc83dc879f841f4"
dependencies = [
"base64 0.21.3",
"rand",
@@ -5962,7 +5962,7 @@ dependencies = [
[[package]]
name = "sync15"
version = "0.1.0"
source = "git+https://github.com/mozilla/application-services?rev=5af28e120fd636135d50894cf16a74e21dc63045#5af28e120fd636135d50894cf16a74e21dc63045"
source = "git+https://github.com/mozilla/application-services?rev=b10c1319e74041b2777e07657fc83dc879f841f4#b10c1319e74041b2777e07657fc83dc879f841f4"
dependencies = [
"anyhow",
"error-support",
@@ -5994,7 +5994,7 @@ dependencies = [
[[package]]
name = "tabs"
version = "0.1.0"
source = "git+https://github.com/mozilla/application-services?rev=5af28e120fd636135d50894cf16a74e21dc63045#5af28e120fd636135d50894cf16a74e21dc63045"
source = "git+https://github.com/mozilla/application-services?rev=b10c1319e74041b2777e07657fc83dc879f841f4#b10c1319e74041b2777e07657fc83dc879f841f4"
dependencies = [
"anyhow",
"error-support",
@@ -6318,7 +6318,7 @@ checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba"
[[package]]
name = "types"
version = "0.1.0"
source = "git+https://github.com/mozilla/application-services?rev=5af28e120fd636135d50894cf16a74e21dc63045#5af28e120fd636135d50894cf16a74e21dc63045"
source = "git+https://github.com/mozilla/application-services?rev=b10c1319e74041b2777e07657fc83dc879f841f4#b10c1319e74041b2777e07657fc83dc879f841f4"
dependencies = [
"rusqlite",
"serde",
@@ -6687,7 +6687,7 @@ checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f"
[[package]]
name = "viaduct"
version = "0.1.0"
source = "git+https://github.com/mozilla/application-services?rev=5af28e120fd636135d50894cf16a74e21dc63045#5af28e120fd636135d50894cf16a74e21dc63045"
source = "git+https://github.com/mozilla/application-services?rev=b10c1319e74041b2777e07657fc83dc879f841f4#b10c1319e74041b2777e07657fc83dc879f841f4"
dependencies = [
"ffi-support",
"log",
@@ -6835,7 +6835,7 @@ dependencies = [
[[package]]
name = "webext-storage"
version = "0.1.0"
source = "git+https://github.com/mozilla/application-services?rev=5af28e120fd636135d50894cf16a74e21dc63045#5af28e120fd636135d50894cf16a74e21dc63045"
source = "git+https://github.com/mozilla/application-services?rev=b10c1319e74041b2777e07657fc83dc879f841f4#b10c1319e74041b2777e07657fc83dc879f841f4"
dependencies = [
"anyhow",
"error-support",

View File

@@ -214,13 +214,13 @@ midir = { git = "https://github.com/mozilla/midir.git", rev = "85156e360a37d8517
malloc_size_of_derive = { path = "xpcom/rust/malloc_size_of_derive" }
# application-services overrides to make updating them all simpler.
interrupt-support = { git = "https://github.com/mozilla/application-services", rev = "5af28e120fd636135d50894cf16a74e21dc63045" }
relevancy = { git = "https://github.com/mozilla/application-services", rev = "5af28e120fd636135d50894cf16a74e21dc63045" }
sql-support = { git = "https://github.com/mozilla/application-services", rev = "5af28e120fd636135d50894cf16a74e21dc63045" }
suggest = { git = "https://github.com/mozilla/application-services", rev = "5af28e120fd636135d50894cf16a74e21dc63045" }
sync15 = { git = "https://github.com/mozilla/application-services", rev = "5af28e120fd636135d50894cf16a74e21dc63045" }
tabs = { git = "https://github.com/mozilla/application-services", rev = "5af28e120fd636135d50894cf16a74e21dc63045" }
viaduct = { git = "https://github.com/mozilla/application-services", rev = "5af28e120fd636135d50894cf16a74e21dc63045" }
webext-storage = { git = "https://github.com/mozilla/application-services", rev = "5af28e120fd636135d50894cf16a74e21dc63045" }
interrupt-support = { git = "https://github.com/mozilla/application-services", rev = "b10c1319e74041b2777e07657fc83dc879f841f4" }
relevancy = { git = "https://github.com/mozilla/application-services", rev = "b10c1319e74041b2777e07657fc83dc879f841f4" }
sql-support = { git = "https://github.com/mozilla/application-services", rev = "b10c1319e74041b2777e07657fc83dc879f841f4" }
suggest = { git = "https://github.com/mozilla/application-services", rev = "b10c1319e74041b2777e07657fc83dc879f841f4" }
sync15 = { git = "https://github.com/mozilla/application-services", rev = "b10c1319e74041b2777e07657fc83dc879f841f4" }
tabs = { git = "https://github.com/mozilla/application-services", rev = "b10c1319e74041b2777e07657fc83dc879f841f4" }
viaduct = { git = "https://github.com/mozilla/application-services", rev = "b10c1319e74041b2777e07657fc83dc879f841f4" }
webext-storage = { git = "https://github.com/mozilla/application-services", rev = "b10c1319e74041b2777e07657fc83dc879f841f4" }
allocator-api2 = { path = "third_party/rust/allocator-api2" }

View File

@@ -155,8 +155,8 @@ export class SuggestBackendRust extends BaseFeature {
suggestion.source = "rust";
suggestion.provider = type;
suggestion.is_sponsored = SPONSORED_SUGGESTION_TYPES.has(type);
if (Array.isArray(suggestion.icon)) {
suggestion.icon_blob = new Blob([new Uint8Array(suggestion.icon)], {
if (suggestion.icon) {
suggestion.icon_blob = new Blob([suggestion.icon], {
type: suggestion.iconMimetype ?? "",
});

View File

@@ -1 +1 @@
{"files":{"Cargo.toml":"c3a30cd6863a999dbc30e64038ddd953a0db0dbf7a977093ff27798e42727773","README.md":"99fb739e79beb2c2d34f38d502cd758a1470b3ecf22c8f7fb05b97f324918cf4","build.rs":"c8d3c38c1208eea36224662b284d8daf3e7ad1b07d22d750524f3da1cc66ccca","src/errorsupport.udl":"e793034d01a2608298528051757f38405e006ee1abc4cf65dc6f18c53590ace8","src/handling.rs":"6e0568b18d426531cb2ae9967c8dd0d51ece5a065f68b15eeb308b995edaa167","src/lib.rs":"96ae3cc2c1077ae45442ace6b5b5311b86267d0b9067f3ff58396af30ccbbc07","src/macros.rs":"0d03f82fab20c96a182f941baf3fcf2a286b00fea871ee7fd8e339abc14f9522","src/redact.rs":"c9a4df1a87be68b15d583587bda941d4c60a1d0449e2d43ff99f3611a290a863","src/reporting.rs":"b8e03402edf3111718fc9c2ec179622307f4a117db05ac220ead631c9de28362","uniffi.toml":"644fe81c12fe3c01ee81e017ca3c00d0e611f014b7eade51aadaf208179a3450"},"package":null}
{"files":{"Cargo.toml":"c3a30cd6863a999dbc30e64038ddd953a0db0dbf7a977093ff27798e42727773","README.md":"99fb739e79beb2c2d34f38d502cd758a1470b3ecf22c8f7fb05b97f324918cf4","build.rs":"c8d3c38c1208eea36224662b284d8daf3e7ad1b07d22d750524f3da1cc66ccca","src/errorsupport.udl":"8f8e5711913ffd1b515ec60028529768990df51001e6125d4b83c948b41c4466","src/handling.rs":"6e0568b18d426531cb2ae9967c8dd0d51ece5a065f68b15eeb308b995edaa167","src/lib.rs":"96ae3cc2c1077ae45442ace6b5b5311b86267d0b9067f3ff58396af30ccbbc07","src/macros.rs":"0d03f82fab20c96a182f941baf3fcf2a286b00fea871ee7fd8e339abc14f9522","src/redact.rs":"c9a4df1a87be68b15d583587bda941d4c60a1d0449e2d43ff99f3611a290a863","src/reporting.rs":"b8e03402edf3111718fc9c2ec179622307f4a117db05ac220ead631c9de28362","uniffi.toml":"4209f3a699d406fdb781ceb2f0409157778949eb598968d23f6ce1a26ba617b0"},"package":null}

View File

@@ -3,10 +3,10 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
namespace errorsupport {
// Set the global error reporter. This is typically done early in startup.
/// Set the global error reporter. This is typically done early in startup.
void set_application_error_reporter(ApplicationErrorReporter error_reporter);
// Unset the global error reporter. This is typically done at shutdown for
// platforms that want to cleanup references like Desktop.
/// Unset the global error reporter. This is typically done at shutdown for
/// platforms that want to cleanup references like Desktop.
void unset_application_error_reporter();
};

View File

@@ -1,8 +1,7 @@
[bindings.kotlin]
package_name = "mozilla.appservices.errorsupport"
cdylib_name = "megazord"
[bindings.swift]
ffi_module_name = "MozillaRustComponents"
ffi_module_filename = "errorFFI"
generate_module_map = false
generate_module_map = false

View File

@@ -1 +1 @@
{"files":{"Cargo.toml":"0847427d394ae20598fcd8db3f73b020cdd6e10f3c84e1e94822ff09cd258e5f","README.md":"7f1418b4a7c138ba20bcaea077fe6cf0d6ffbaf6df6b90c80efc52aa0d0e2e9f","build.rs":"49840f26c73c5db19cb4e7f02930e49d7a19648168b83f2313ac1a0303c103df","src/error.rs":"b83cbe8abd22a9d687508d236a2a77e28b3fc6c39673633e5820cc0e3fc86cba","src/interrupt_support.udl":"31181937f89dbc229837484dec47a228955bb1b6c47d3b049d91f23cbe7dc069","src/interruptee.rs":"c56f9ac610d0b24a128a907266432287558c4b73f6c24b82674ca7894181d18f","src/lib.rs":"cf44a84310913be5264e1c4a3e004a9f7a6cd82d01a109bb6ac4d6002b5dd560","src/shutdown.rs":"e4b7a89f1ef319646aee3282a0d60465c3dbf571c52a0295f3b1a8909f345818","src/sql.rs":"db9b93fb2fe813ae0af6313082f07fad0e381691290466a7ac67bec14024722d"},"package":null}
{"files":{"Cargo.toml":"0847427d394ae20598fcd8db3f73b020cdd6e10f3c84e1e94822ff09cd258e5f","README.md":"7f1418b4a7c138ba20bcaea077fe6cf0d6ffbaf6df6b90c80efc52aa0d0e2e9f","build.rs":"49840f26c73c5db19cb4e7f02930e49d7a19648168b83f2313ac1a0303c103df","src/error.rs":"b83cbe8abd22a9d687508d236a2a77e28b3fc6c39673633e5820cc0e3fc86cba","src/interrupt_support.udl":"bac2d5a94b5ae5d1b819b2058b82c541e02b1f75ef157c1eb236bfb4f0c78a05","src/interruptee.rs":"c56f9ac610d0b24a128a907266432287558c4b73f6c24b82674ca7894181d18f","src/lib.rs":"cf44a84310913be5264e1c4a3e004a9f7a6cd82d01a109bb6ac4d6002b5dd560","src/shutdown.rs":"e4b7a89f1ef319646aee3282a0d60465c3dbf571c52a0295f3b1a8909f345818","src/sql.rs":"db9b93fb2fe813ae0af6313082f07fad0e381691290466a7ac67bec14024722d"},"package":null}

View File

@@ -1,5 +1,5 @@
namespace interrupt_support {
// Enter shutdown mode, causing all current and future interruptible operations to be interrupted.
/// Enter shutdown mode, causing all current and future interruptible operations to be interrupted.
void shutdown();
};

View File

@@ -1 +1 @@
{"files":{"Cargo.toml":"e4be9cbc32284841e52cf4e10d6c42ff7cd6f608be4aa7a0a172999d089ad75d","build.rs":"a562bfe527d21c4e8a1a44b892defa83cdff141ec5dd51ed6f3862330e50ddd7","src/bin/generate-test-data.rs":"7f1c9dc445418c7627f89d1f2aa8e550d0f85b3d1f05edb7c378ab9441714f1f","src/db.rs":"84fa47dc54f113769ce9ec6f827c8813abed61d5e5fc82404816266703a5c668","src/error.rs":"bda332098f9759e4250c725b09d82704ba03c9ad87dc761414fa21f40220acf5","src/ingest.rs":"58bb3ed984aa5a9becb405793832e578586be744d3c4a1c411fdfb7ff48c55dd","src/interest.rs":"73baa578b40b96d13899016b14087c9ac37b754c1311e2798b1d09c719447751","src/lib.rs":"214fdbeb25e0753ef132245e6892d77cad0ddd87c96d9bdd7f3427bc5d11091e","src/relevancy.udl":"9f463bbc2a7ef28358ffbfe832e62ddd6127888c484576466c759b127a55c4b2","src/rs.rs":"cff2351c9e1b45bb67ee945650fd74b45ed48815851e58b8dbf39e66a30c10a3","src/schema.rs":"919f4d1d3654bad966c5ce93ac157dc17cac2f35e7b8c2efc471b9af562555db","src/url_hash.rs":"2e908316fb70923644d1990dbf470d69ce2f5e99b0c5c3d95ec691590be8ffa5","test-data":"1ef2cd092d59e7e126cd4a514af983d449ed9f9c98708702fd237464a76c2b5e"},"package":null}
{"files":{"Cargo.toml":"7632bb813a3ea543bc91b376f413360a0438b5ca71833cca2cef5b2de500be14","src/bin/generate-test-data.rs":"7f1c9dc445418c7627f89d1f2aa8e550d0f85b3d1f05edb7c378ab9441714f1f","src/db.rs":"84fa47dc54f113769ce9ec6f827c8813abed61d5e5fc82404816266703a5c668","src/error.rs":"69824aa70fb8b59fe23a9acc625318e330015b80145c8133a6c0f17460bd3e36","src/ingest.rs":"58bb3ed984aa5a9becb405793832e578586be744d3c4a1c411fdfb7ff48c55dd","src/interest.rs":"e4369a1280867438bca12746f71288a03b4d5e180e156f4bc0335046012565f7","src/lib.rs":"182342da404b98973f59f97e40d946c29612c3833fd1c1bb1e45d55bd43d5239","src/ranker.rs":"691e6e52b8e0d06ffcac54c9b036a854f2f60c34706a7706128ad1acbe64f8f6","src/rs.rs":"cff2351c9e1b45bb67ee945650fd74b45ed48815851e58b8dbf39e66a30c10a3","src/schema.rs":"919f4d1d3654bad966c5ce93ac157dc17cac2f35e7b8c2efc471b9af562555db","src/url_hash.rs":"2e908316fb70923644d1990dbf470d69ce2f5e99b0c5c3d95ec691590be8ffa5","test-data":"1ef2cd092d59e7e126cd4a514af983d449ed9f9c98708702fd237464a76c2b5e"},"package":null}

View File

@@ -13,7 +13,7 @@
edition = "2021"
name = "relevancy"
version = "0.1.0"
build = "build.rs"
build = false
exclude = [
"/android",
"/ios",

View File

@@ -1,8 +0,0 @@
/* 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/.
*/
fn main() {
uniffi::generate_scaffolding("./src/relevancy.udl").unwrap();
}

View File

@@ -6,7 +6,7 @@
use error_support::{ErrorHandling, GetErrorHandling};
/// Errors we return via the public interface.
#[derive(Debug, thiserror::Error)]
#[derive(Debug, thiserror::Error, uniffi::Error)]
pub enum RelevancyApiError {
#[error("Unexpected Error: {reason}")]
Unexpected { reason: String },

View File

@@ -34,7 +34,7 @@ impl ToSql for InterestVectorKind {
/// List of possible interests for a domain. Domains can have be associated with one or multiple
/// interests. `Inconclusive` is used for domains in the user's top sites that we can't classify
/// because there's no corresponding entry in the interest database.
#[derive(Clone, Copy, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)]
#[derive(Clone, Copy, Debug, Hash, PartialEq, Eq, PartialOrd, Ord, uniffi::Enum)]
#[repr(u32)]
pub enum Interest {
// Note: if you change these codes, make sure to update the `TryFrom<u32>` implementation and
@@ -149,7 +149,7 @@ impl ToSql for Interest {
///
/// Here "vector" refers to the mathematical object, not a Rust `Vec`. It always has a fixed
/// number of elements.
#[derive(Debug, Default, PartialEq, Eq)]
#[derive(Debug, Default, PartialEq, Eq, uniffi::Record)]
pub struct InterestVector {
pub inconclusive: u32,
pub animals: u32,

View File

@@ -13,6 +13,7 @@ mod db;
mod error;
mod ingest;
mod interest;
mod ranker;
mod rs;
mod schema;
pub mod url_hash;
@@ -20,36 +21,43 @@ pub mod url_hash;
pub use db::RelevancyDb;
pub use error::{ApiResult, Error, RelevancyApiError, Result};
pub use interest::{Interest, InterestVector};
pub use ranker::score;
use error_support::handle_error;
uniffi::setup_scaffolding!();
#[derive(uniffi::Object)]
pub struct RelevancyStore {
db: RelevancyDb,
}
/// Top-level API for the Relevancy component
// Impl block to be exported via `UniFFI`.
#[uniffi::export]
impl RelevancyStore {
/// Construct a new RelevancyStore
///
/// This is non-blocking since databases and other resources are lazily opened.
#[uniffi::constructor]
pub fn new(db_path: String) -> Self {
Self {
db: RelevancyDb::new(db_path),
}
}
/// Close any open resources (for example databases)
///
/// Calling `close` will interrupt any in-progress queries on other threads.
pub fn close(&self) {
self.db.close()
}
/// Interrupt any current database queries
pub fn interrupt(&self) {
self.db.interrupt()
}
/// Download the interest data from remote settings if needed
#[handle_error(Error)]
pub fn ensure_interest_data_populated(&self) -> ApiResult<()> {
ingest::ensure_interest_data_populated(&self.db)?;
Ok(())
}
/// Ingest top URLs to build the user's interest vector.
///
/// Consumer should pass a list of the user's top URLs by frecency to this method. It will
@@ -70,17 +78,6 @@ impl RelevancyStore {
Ok(interest_vec)
}
pub fn classify(&self, top_urls_by_frecency: Vec<String>) -> Result<InterestVector> {
let mut interest_vector = InterestVector::default();
for url in top_urls_by_frecency {
let interest_count = self.db.read(|dao| dao.get_url_interest_vector(&url))?;
log::trace!("classified: {url} {}", interest_count.summary());
interest_vector = interest_vector + interest_count;
}
Ok(interest_vector)
}
/// Calculate metrics for the validation phase
///
/// This runs after [Self::ingest]. It takes the interest vector that ingest created and
@@ -96,18 +93,54 @@ impl RelevancyStore {
/// consumer can show it in an `about:` page.
#[handle_error(Error)]
pub fn user_interest_vector(&self) -> ApiResult<InterestVector> {
todo!()
self.db.read(|dao| dao.get_frecency_user_interest_vector())
}
}
/// Interest metric data. See `relevancy.udl` for details.
pub struct InterestMetrics {
pub top_single_interest_similarity: u32,
pub top_2interest_similarity: u32,
pub top_3interest_similarity: u32,
impl RelevancyStore {
/// Download the interest data from remote settings if needed
#[handle_error(Error)]
pub fn ensure_interest_data_populated(&self) -> ApiResult<()> {
ingest::ensure_interest_data_populated(&self.db)?;
Ok(())
}
pub fn classify(&self, top_urls_by_frecency: Vec<String>) -> Result<InterestVector> {
let mut interest_vector = InterestVector::default();
for url in top_urls_by_frecency {
let interest_count = self.db.read(|dao| dao.get_url_interest_vector(&url))?;
log::trace!("classified: {url} {}", interest_count.summary());
interest_vector = interest_vector + interest_count;
}
Ok(interest_vector)
}
}
uniffi::include_scaffolding!("relevancy");
/// Interest metrics that we want to send to Glean as part of the validation process. These contain
/// the cosine similarity when comparing the user's interest against various interest vectors that
/// consumers may use.
///
/// Cosine similarly was chosen because it seems easy to calculate. This was then matched against
/// some semi-plausible real-world interest vectors that consumers might use. This is all up for
/// debate and we may decide to switch to some other metrics.
///
/// Similarity values are transformed to integers by multiplying the floating point value by 1000 and
/// rounding. This is to make them compatible with Glean's distribution metrics.
#[derive(uniffi::Record)]
pub struct InterestMetrics {
/// Similarity between the user's interest vector and an interest vector where the element for
/// the user's top interest is copied, but all other interests are set to zero. This measures
/// the highest possible similarity with consumers that used interest vectors with a single
/// interest set.
pub top_single_interest_similarity: u32,
/// The same as before, but the top 2 interests are copied. This measures the highest possible
/// similarity with consumers that used interest vectors with a two interests (note: this means
/// they would need to choose the user's top two interests and have the exact same proportion
/// between them as the user).
pub top_2interest_similarity: u32,
/// The same as before, but the top 3 interests are copied.
pub top_3interest_similarity: u32,
}
#[cfg(test)]
mod test {
@@ -115,38 +148,63 @@ mod test {
use super::*;
#[test]
fn test_ingest() {
let top_urls = vec![
"https://food.com/".to_string(),
"https://hello.com".to_string(),
"https://pasta.com".to_string(),
"https://dog.com".to_string(),
];
fn make_fixture() -> Vec<(String, Interest)> {
vec![
("https://food.com/".to_string(), Interest::Food),
("https://hello.com".to_string(), Interest::Inconclusive),
("https://pasta.com".to_string(), Interest::Food),
("https://dog.com".to_string(), Interest::Animals),
]
}
fn expected_interest_vector() -> InterestVector {
InterestVector {
inconclusive: 1,
animals: 1,
food: 2,
..InterestVector::default()
}
}
fn setup_store(test_id: &'static str) -> RelevancyStore {
let relevancy_store =
RelevancyStore::new("file:test_store_data?mode=memory&cache=shared".to_owned());
RelevancyStore::new(format!("file:test_{test_id}_data?mode=memory&cache=shared"));
relevancy_store
.db
.read_write(|dao| {
dao.add_url_interest(hash_url("https://food.com").unwrap(), Interest::Food)?;
dao.add_url_interest(
hash_url("https://hello.com").unwrap(),
Interest::Inconclusive,
)?;
dao.add_url_interest(hash_url("https://pasta.com").unwrap(), Interest::Food)?;
dao.add_url_interest(hash_url("https://dog.com").unwrap(), Interest::Animals)?;
for (url, interest) in make_fixture() {
dao.add_url_interest(hash_url(&url).unwrap(), interest)?;
}
Ok(())
})
.expect("Insert should succeed");
relevancy_store
}
#[test]
fn test_ingest() {
let relevancy_store = setup_store("ingest");
let (top_urls, _): (Vec<String>, Vec<Interest>) = make_fixture().into_iter().unzip();
assert_eq!(
relevancy_store.ingest(top_urls).unwrap(),
InterestVector {
inconclusive: 1,
animals: 1,
food: 2,
..InterestVector::default()
}
expected_interest_vector()
);
}
#[test]
fn test_get_user_interest_vector() {
let relevancy_store = setup_store("get_user_interest_vector");
let (top_urls, _): (Vec<String>, Vec<Interest>) = make_fixture().into_iter().unzip();
relevancy_store
.ingest(top_urls)
.expect("Ingest should succeed");
assert_eq!(
relevancy_store.user_interest_vector().unwrap(),
expected_interest_vector()
);
}
}

116
third_party/rust/relevancy/src/ranker.rs vendored Normal file
View File

@@ -0,0 +1,116 @@
use std::cmp::max;
use crate::interest::{Interest, InterestVector};
/// Calculate score for a piece of categorized content based on a user interest vector.
///
/// This scoring function is of the following properties:
/// - The score ranges from 0.0 to 1.0
/// - The score is monotonically increasing for the accumulated interest count
///
/// Params:
/// - `interest_vector`: a user interest vector that can be fetched via
/// `RelevancyStore::user_interest_vector()`.
/// - `content_categories`: a list of categories (interests) of the give content.
/// Return:
// - A score ranges in [0, 1].
#[uniffi::export]
pub fn score(interest_vector: InterestVector, content_categories: Vec<Interest>) -> f64 {
let n = content_categories
.iter()
.fold(0, |acc, &category| acc + interest_vector[category]);
// Apply base 10 logarithm to the accumulated count so its hyperbolic tangent is more
// evenly distributed in [0, 1]. Note that `max(n, 1)` is used to avoid negative scores.
(max(n, 1) as f64).log10().tanh()
}
#[cfg(test)]
mod test {
use crate::interest::{Interest, InterestVector};
use super::*;
const EPSILON: f64 = 1e-10;
const SUBEPSILON: f64 = 1e-6;
#[test]
fn test_score_lower_bound() {
// Empty interest vector yields score 0.
let s = score(InterestVector::default(), vec![Interest::Food]);
let delta = (s - 0_f64).abs();
assert!(delta < EPSILON);
// No overlap also yields score 0.
let s = score(
InterestVector {
animals: 10,
..InterestVector::default()
},
vec![Interest::Food],
);
let delta = (s - 0_f64).abs();
assert!(delta < EPSILON);
}
#[test]
fn test_score_upper_bound() {
let score = score(
InterestVector {
animals: 1_000_000_000,
..InterestVector::default()
},
vec![Interest::Animals],
);
let delta = (score - 1.0_f64).abs();
// Can get very close to the upper bound 1.0 but not over.
assert!(delta < SUBEPSILON);
}
#[test]
fn test_score_monotonic() {
let l = score(
InterestVector {
animals: 1,
..InterestVector::default()
},
vec![Interest::Animals],
);
let r = score(
InterestVector {
animals: 5,
..InterestVector::default()
},
vec![Interest::Animals],
);
assert!(l < r);
}
#[test]
fn test_score_multi_categories() {
let l = score(
InterestVector {
animals: 100,
food: 100,
..InterestVector::default()
},
vec![Interest::Animals, Interest::Food],
);
let r = score(
InterestVector {
animals: 200,
..InterestVector::default()
},
vec![Interest::Animals],
);
let delta = (l - r).abs();
assert!(delta < EPSILON);
}
}

View File

@@ -1,115 +0,0 @@
namespace relevancy { };
[Error]
interface RelevancyApiError {
Unexpected(string reason);
};
// Top-level class for the Relevancy component
interface RelevancyStore {
// Construct a new RelevancyStore
//
// This is non-blocking since databases and other resources are lazily opened.
constructor(string dbpath);
// Close any open resources (for example databases)
//
// Calling `close` will interrupt any in-progress queries on other threads.
void close();
// Interrupt any current database queries
void interrupt();
// Ingest the top URLs by frequency to build up the user's interest vector
[Throws=RelevancyApiError]
InterestVector ingest(sequence<string> top_urls);
// Calculate metrics for the user's interest vector in order to measure how strongly we're
// identifying interests. See the `InterestMetrics` struct for details.
[Throws=RelevancyApiError]
InterestMetrics calculate_metrics();
// Get the interest vector for the user.
//
// This is intended to be show to the user in an `about:` page so that users can judge if it
// feels correct.
[Throws=RelevancyApiError]
InterestVector user_interest_vector();
};
enum Interest {
"Animals",
"Arts",
"Autos",
"Business",
"Career",
"Education",
"Fashion",
"Finance",
"Food",
"Government",
// "Health",
"Hobbies",
"Home",
"News",
"RealEstate",
"Society",
"Sports",
"Tech",
"Travel",
"Inconclusive",
};
// Interest metrics that we want to send to Glean as part of the validation process. These contain
// the cosine similarity when comparing the user's interest against various interest vectors that
// consumers may use.
//
// Cosine similarly was chosen because it seems easy to calculate. This was then matched against
// some semi-plausible real-world interest vectors that consumers might use. This is all up for
// debate and we may decide to switch to some other metrics.
//
// Similarity values are transformed to integers by multiplying the floating point value by 1000 and
// rounding. This is to make them compatible with Glean's distribution metrics.
dictionary InterestMetrics {
// Similarity between the user's interest vector and an interest vector where the element for
// the user's top interest is copied, but all other interests are set to zero. This measures
// the highest possible similarity with consumers that used interest vectors with a single
// interest set.
u32 top_single_interest_similarity;
// The same as before, but the top 2 interests are copied. This measures the highest possible
// similarity with consumers that used interest vectors with a two interests (note: this means
// they would need to choose the user's top two interests and have the exact same proportion
// between them as the user).
u32 top_2interest_similarity;
// The same as before, but the top 3 interests are copied.
u32 top_3interest_similarity;
};
// Vector storing a count value for each interest
//
// Here "vector" refers to the mathematical object, not a Rust `Vec`. It always has a fixed
// number of elements.
dictionary InterestVector {
u32 animals;
u32 arts;
u32 autos;
u32 business;
u32 career;
u32 education;
u32 fashion;
u32 finance;
u32 food;
u32 government;
// u32 health;
u32 hobbies;
u32 home;
u32 news;
u32 real_estate;
u32 society;
u32 sports;
u32 tech;
u32 travel;
u32 inconclusive;
};

View File

@@ -1 +1 @@
{"files":{"Cargo.toml":"ef5518defeff51631af71f1cbcc975d4dabbcb945ba4b1daf92e73ec5c96674a","build.rs":"4326f03729cf8f1673e4228e6dc111de1ea4d8bcc06351f7ae563efb2613f866","src/cache.rs":"9c16f17353730103d57132a0f055863b085d2d3eb3a78f6a6f8d095f897d0c0d","src/client.rs":"1c589317907d21745e945dfd992c11535aaafcaca9a6ebe33a5a7c2e2cb93997","src/config.rs":"52a209256acd8b1fada2b91e9d9f669df0ee6e9609baad7ec34a2111ed2a6541","src/error.rs":"4bb15cd7f6ebc438119f36291ab0eb951fe2fb05e166445817cb05aa89397000","src/lib.rs":"ff1b9f66ae6069005d36c84b296f22424b4305a5873353e351fbe057f126e140","src/remote_settings.udl":"1ffeb10385e4db63606cda79bb59e77170af1d2ca0028da8ab2c4d7622969734","uniffi.toml":"f8ec8dc593e0d501c2e9e40368ec93ec33b1edd8608e29495e0a54b63144e880"},"package":null}
{"files":{"Cargo.toml":"ef5518defeff51631af71f1cbcc975d4dabbcb945ba4b1daf92e73ec5c96674a","build.rs":"4326f03729cf8f1673e4228e6dc111de1ea4d8bcc06351f7ae563efb2613f866","src/cache.rs":"9c16f17353730103d57132a0f055863b085d2d3eb3a78f6a6f8d095f897d0c0d","src/client.rs":"1c589317907d21745e945dfd992c11535aaafcaca9a6ebe33a5a7c2e2cb93997","src/config.rs":"52a209256acd8b1fada2b91e9d9f669df0ee6e9609baad7ec34a2111ed2a6541","src/error.rs":"4bb15cd7f6ebc438119f36291ab0eb951fe2fb05e166445817cb05aa89397000","src/lib.rs":"ff1b9f66ae6069005d36c84b296f22424b4305a5873353e351fbe057f126e140","src/remote_settings.udl":"e9e9d06ea7497200d84a2c95a494c5f46b7b74c79e45477765c343199a50915c","uniffi.toml":"6f57aa54cef1a5f6d988ed1d46e3fa54413c1e596a793e2cbbc0b6e246ee5c00"},"package":null}

View File

@@ -56,20 +56,20 @@ enum RemoteSettingsError {
};
interface RemoteSettings {
// Construct a new Remote Settings client with the given configuration.
/// Construct a new Remote Settings client with the given configuration.
[Throws=RemoteSettingsError]
constructor(RemoteSettingsConfig remote_settings_config);
// Fetch all records for the configuration this client was initialized with.
/// Fetch all records for the configuration this client was initialized with.
[Throws=RemoteSettingsError]
RemoteSettingsResponse get_records();
// Fetch all records added to the server since the provided timestamp,
// using the configuration this client was initialized with.
/// Fetch all records added to the server since the provided timestamp,
/// using the configuration this client was initialized with.
[Throws=RemoteSettingsError]
RemoteSettingsResponse get_records_since(u64 timestamp);
// Download an attachment with the provided id to the provided path.
/// Download an attachment with the provided id to the provided path.
[Throws=RemoteSettingsError]
void download_attachment_to_path(string attachment_id, string path);
};

View File

@@ -1,6 +1,5 @@
[bindings.kotlin]
package_name = "mozilla.appservices.remotesettings"
cdylib_name = "megazord"
[bindings.kotlin.custom_types.RsJsonObject]
# Name of the type in the Kotlin code

View File

@@ -1 +1 @@
{"files":{"Cargo.toml":"5bd232c57c616e21a9053a5fed647dadfe368ba94a02cba44373b90cdc8f0314","README.md":"5e28baf874b643d756228bdab345e287bf107d3182dfe6a18aafadcc4b9a3fc9","benches/benchmark_all.rs":"3582f21af9758766ff32ed95f90b69984b32091b1e31e0c0bef307c22fd82f18","build.rs":"78780c5cccfe22c3ff4198624b9e188559c437c3e6fa1c8bb66548eee6aa66bf","metrics.yaml":"0540ab2271aeab7f07335c7ceec12acde942995f9dcb3c29070489aa61899d56","src/benchmarks/README.md":"ccee8dbddba8762d0453fa855bd6984137b224b8c019f3dd8e86a3c303f51d71","src/benchmarks/client.rs":"3b92c350ad396b0e0b5438c7b7b94b08b322702f419ca9b815e6732bd174f8a1","src/benchmarks/ingest.rs":"ca368573591519e6b777d659d5615718bedb6eee1734e25242627f8116b10881","src/benchmarks/mod.rs":"2d7c20d47d6c7e17bc738255a31119bd0c4a4e495419a00c7b10b251ace9ef6b","src/benchmarks/query.rs":"ce78057e0ed43a419cc92d2bceb0bbef8aad9b113ef0341cf5f1d8d1578848e0","src/bin/debug_ingestion_sizes.rs":"ce6e810be7b3fc19e826d75b622b82cfab5a1a99397a6d0833c2c4eebff2d364","src/config.rs":"d40c6e83d8b5faa32c66110803ca9e78611d43507e9d3f1e191a93a7773c37b3","src/db.rs":"96156fcb8f8dc9dd98334d77fc53623046529dcf6b57f6282f120ad33cb8bcac","src/error.rs":"183a92511565439915275e0705e6740ff513c2549f2ef78fd3055d8aaaf81021","src/fakespot.rs":"03d3aac07b3a3a9ceb8d2c452d4a122bfebf04579829e62e83487877055312d4","src/keyword.rs":"988d0ab021c0df19cfd3c519df7d37f606bf984cd14d0efca4e5a7aff88344dd","src/lib.rs":"ab7fa1005cc371b15fde5211d7dabae5034f3b236580047655897be30280b2c9","src/metrics.rs":"b3b9816b8eda366f808b56e242ac6aa43a5b141ad01d43420fdfcbfca13e1cfc","src/pocket.rs":"1316668840ec9b4ea886223921dc9d3b5a1731d1a5206c0b1089f2a6c45c1b7b","src/provider.rs":"3ad644f7b3942e4228bdc9ec03e12af5faa55e3f9ab668617bef98e4c61ee1f7","src/query.rs":"6b94eb913908c36798129311bf519fa76478c6d35c2154efd639c4ba26b95a59","src/rs.rs":"16cf7fae7e935ef94beab532537564975addcd35b1a9b4b4a9fa1d34d51fbcfb","src/schema.rs":"5f2449c6ef798addf6b1d9869936edfe0629f6d543f3cb957becdf0595b29a41","src/store.rs":"57d00989eca564ce1497fa813b2f1bdf8acb8cbba1603fe6000c3abef37e5959","src/suggest.udl":"ba5e99a5d8c09ade945d537e0f90276cc6964ebc9ff454e5dbe5c9b3ba58f8eb","src/suggestion.rs":"3a91ecd648183f34b3834f5eaa14e487f29d8b227e7d4755288c3eade6d990e3","src/testing/client.rs":"f8c9bd32d0f4cf364daebe114d580c7e36a83b69c07884d14170969620d9a437","src/testing/data.rs":"d4fc5227996a8b115d93243fdbd83bc57d73a8c2d4c0b20dffa15bbec27925cb","src/testing/mod.rs":"800e5317bc2e13ee2b416bb0eb5c25ad9108a1afe8c73c9d2f6787572aa95c3a","src/yelp.rs":"bc036ff71b438d53ce8811acd8d650d83ef03faeea476f5b659b403c1e64ff2b","uniffi.toml":"f26317442ddb5b3281245bef6e60ffcb78bb95d29fe4a351a56dbb88d4ec8aab"},"package":null}
{"files":{"Cargo.toml":"c3f0963042528b30aa6dc1a434540af4241788a6f8785e3b86d26f166a954846","README.md":"5e28baf874b643d756228bdab345e287bf107d3182dfe6a18aafadcc4b9a3fc9","benches/benchmark_all.rs":"3582f21af9758766ff32ed95f90b69984b32091b1e31e0c0bef307c22fd82f18","metrics.yaml":"0540ab2271aeab7f07335c7ceec12acde942995f9dcb3c29070489aa61899d56","src/benchmarks/README.md":"ccee8dbddba8762d0453fa855bd6984137b224b8c019f3dd8e86a3c303f51d71","src/benchmarks/client.rs":"2f4b7a841d5e62c5e757f76c0aa2a82d5a227c4dc96ecc054ca882df1395cbba","src/benchmarks/ingest.rs":"504d00f09e88e01676ee2de3787b942a538e1ae7b46919e937df3f5b8edd8be9","src/benchmarks/mod.rs":"2d7c20d47d6c7e17bc738255a31119bd0c4a4e495419a00c7b10b251ace9ef6b","src/benchmarks/query.rs":"ce78057e0ed43a419cc92d2bceb0bbef8aad9b113ef0341cf5f1d8d1578848e0","src/bin/debug_ingestion_sizes.rs":"ce6e810be7b3fc19e826d75b622b82cfab5a1a99397a6d0833c2c4eebff2d364","src/config.rs":"0eed97967e928315f35272dd5278ed1c39b0c3db561b56345c1417de2a3cb3b5","src/db.rs":"96156fcb8f8dc9dd98334d77fc53623046529dcf6b57f6282f120ad33cb8bcac","src/error.rs":"b7a77f96588bf70aeefa39cc87fcc1478b7e742fc84df3a41d9ac351ba07ab1a","src/fakespot.rs":"03d3aac07b3a3a9ceb8d2c452d4a122bfebf04579829e62e83487877055312d4","src/keyword.rs":"988d0ab021c0df19cfd3c519df7d37f606bf984cd14d0efca4e5a7aff88344dd","src/lib.rs":"fa8fb7bdddcda24b8e24db80f50207fe6b39ba318f0d0c1df7bd9a89be3ffa29","src/metrics.rs":"6e390af144e3e0644ab87a79ded0c76421658ab7d10201fb8b93dd7e299e9d27","src/pocket.rs":"1316668840ec9b4ea886223921dc9d3b5a1731d1a5206c0b1089f2a6c45c1b7b","src/provider.rs":"a2aa1352e0d62895b8ccd45ffeeac20b61df23411ce01125c97638d777d1eba2","src/query.rs":"84b97997036a3a597b0574e719e7407ddf0f18bd55c07a704bd2cacd549e8509","src/rs.rs":"16cf7fae7e935ef94beab532537564975addcd35b1a9b4b4a9fa1d34d51fbcfb","src/schema.rs":"5f2449c6ef798addf6b1d9869936edfe0629f6d543f3cb957becdf0595b29a41","src/store.rs":"983260058e633de3d4559356273cb50bfcb0d0a746481e797002756cba5ad043","src/suggestion.rs":"84027762895b715c83ca60639267effbdc7a7a34678f75db686d13047d259b6b","src/testing/client.rs":"f8c9bd32d0f4cf364daebe114d580c7e36a83b69c07884d14170969620d9a437","src/testing/data.rs":"d4fc5227996a8b115d93243fdbd83bc57d73a8c2d4c0b20dffa15bbec27925cb","src/testing/mod.rs":"800e5317bc2e13ee2b416bb0eb5c25ad9108a1afe8c73c9d2f6787572aa95c3a","src/yelp.rs":"bc036ff71b438d53ce8811acd8d650d83ef03faeea476f5b659b403c1e64ff2b","uniffi.toml":"19ea9cfd30d2e57ffad125b7eeef7f9228d43347fceb8bb9a54a0e66177eb2e5"},"package":null}

View File

@@ -13,7 +13,7 @@
edition = "2021"
name = "suggest"
version = "0.1.0"
build = "build.rs"
build = false
exclude = [
"/android",
"/ios",

View File

@@ -1,7 +0,0 @@
/* 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/. */
fn main() {
uniffi::generate_scaffolding("./src/suggest.udl").unwrap();
}

View File

@@ -62,6 +62,25 @@ impl RemoteSettingsBenchmarkClient {
Ok(())
}
pub fn attachment_size_by_record_type(&self) -> Vec<(rs::SuggestRecordType, usize)> {
let mut sizes = HashMap::<rs::SuggestRecordType, usize>::new();
for record in self.records.iter() {
let record_type = rs::SuggestRecordType::from(&record.payload);
if let Some(a) = &record.attachment {
if let Some(attachment) = self.attachments.get(&a.location) {
sizes
.entry(record_type)
.and_modify(|size| *size += attachment.len())
.or_insert(attachment.len());
}
}
}
let mut sizes_vec: Vec<_> = sizes.into_iter().collect();
sizes_vec.sort_by_key(|(_, size)| *size);
sizes_vec.reverse();
sizes_vec
}
pub fn total_attachment_size(&self) -> usize {
self.attachments.values().map(|a| a.len()).sum()
}

View File

@@ -170,17 +170,24 @@ pub fn print_debug_ingestion_sizes() {
let table_row_counts = store.table_row_counts();
let db_size = store.db_size();
let client = store.into_settings_client();
let total_attachment_size: usize = client.total_attachment_size();
println!("Attachment sizes");
println!("-------------------------");
let attachment_sizes = client.attachment_size_by_record_type();
let total_attachment_size: usize = attachment_sizes.iter().map(|(_, size)| size).sum();
for (record_type, size) in attachment_sizes {
println!("{:30} {}kb", record_type.as_str(), (size + 500) / 1000)
}
println!();
println!(
"Total attachment size: {}kb",
(total_attachment_size + 500) / 1000
);
println!("Total database size: {}kb", (db_size + 500) / 1000);
println!();
println!("Database table row counts");
println!("-------------------------");
for (name, count) in table_row_counts {
println!("{name:30}: {count}");
println!("{name:30} {count}");
}
println!();
println!("Total database size: {}kb", (db_size + 500) / 1000);
}

View File

@@ -8,7 +8,7 @@ use serde::{Deserialize, Serialize};
use crate::rs::{DownloadedGlobalConfig, DownloadedWeatherData};
/// Global Suggest configuration data.
#[derive(Clone, Default, Debug, Deserialize, Serialize, PartialEq, Eq)]
#[derive(Clone, Default, Debug, Deserialize, Serialize, PartialEq, Eq, uniffi::Record)]
pub struct SuggestGlobalConfig {
pub show_less_frequently_cap: i32,
}
@@ -22,7 +22,7 @@ impl From<&DownloadedGlobalConfig> for SuggestGlobalConfig {
}
/// Per-provider configuration data.
#[derive(Clone, Debug, Deserialize, Serialize, PartialEq, Eq)]
#[derive(Clone, Debug, Deserialize, Serialize, PartialEq, Eq, uniffi::Enum)]
pub enum SuggestProviderConfig {
Weather { min_keyword_length: i32 },
}

View File

@@ -79,15 +79,15 @@ pub impl<T> Result<T, rusqlite::Error> {
/// The error type for all Suggest component operations. These errors are
/// exposed to your application, which should handle them as needed.
#[derive(Debug, thiserror::Error)]
#[derive(Debug, thiserror::Error, uniffi::Error)]
#[non_exhaustive]
pub enum SuggestApiError {
#[error("Network error: {reason}")]
Network { reason: String },
// The server requested a backoff after too many requests
/// The server requested a backoff after too many requests
#[error("Backoff")]
Backoff { seconds: u64 },
// The application interrupted a request
/// An operation was interrupted by calling `SuggestStore.interrupt()`
#[error("Interrupted")]
Interrupted,
#[error("Other error: {reason}")]

View File

@@ -24,14 +24,16 @@ mod testing;
mod yelp;
pub use config::{SuggestGlobalConfig, SuggestProviderConfig};
pub use error::SuggestApiError;
pub use error::{Error, SuggestApiError};
pub use metrics::{LabeledTimingSample, SuggestIngestionMetrics};
pub use provider::{SuggestionProvider, SuggestionProviderConstraints};
pub use query::{QueryWithMetricsResult, SuggestionQuery};
pub use store::{InterruptKind, SuggestIngestionConstraints, SuggestStore, SuggestStoreBuilder};
pub use suggestion::{raw_suggestion_url_matches, Suggestion};
pub(crate) type Result<T> = std::result::Result<T, error::Error>;
pub type SuggestApiResult<T> = std::result::Result<T, error::SuggestApiError>;
pub(crate) type Result<T> = std::result::Result<T, Error>;
pub type SuggestApiResult<T> = std::result::Result<T, SuggestApiError>;
uniffi::include_scaffolding!("suggest");
uniffi::use_udl_record!(remote_settings, RemoteSettingsConfig);
uniffi::use_udl_enum!(remote_settings, RemoteSettingsServer);
uniffi::setup_scaffolding!();

View File

@@ -5,9 +5,11 @@
use std::time::Instant;
/// Single sample for a Glean labeled_timing_distribution
#[derive(uniffi::Record)]
pub struct LabeledTimingSample {
pub label: String,
pub value: u64, // time in microseconds
/// Time in microseconds
pub value: u64,
}
impl LabeledTimingSample {
@@ -19,9 +21,11 @@ impl LabeledTimingSample {
/// Ingestion metrics
///
/// These are recorded during [crate::Store::ingest] and returned to the consumer to record.
#[derive(Default)]
#[derive(Default, uniffi::Record)]
pub struct SuggestIngestionMetrics {
/// Samples for the `suggest.ingestion_time` metric
pub ingestion_times: Vec<LabeledTimingSample>,
/// Samples for the `suggest.ingestion_download_time` metric
pub download_times: Vec<LabeledTimingSample>,
}

View File

@@ -24,7 +24,7 @@ pub(crate) const DEFAULT_INGEST_PROVIDERS: [SuggestionProvider; 6] = [
];
/// A provider is a source of search suggestions.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)]
#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash, uniffi::Enum)]
#[repr(u8)]
pub enum SuggestionProvider {
Amp = 1,
@@ -121,7 +121,13 @@ impl ToSql for SuggestionProvider {
}
}
#[derive(Clone, Default, Debug)]
/// Some providers manage multiple suggestion subtypes. Queries, ingests, and
/// other operations on those providers must be constrained to a desired subtype.
#[derive(Clone, Default, Debug, uniffi::Record)]
pub struct SuggestionProviderConstraints {
/// `Exposure` provider - For each desired exposure suggestion type, this
/// should contain the value of the `suggestion_type` field of its remote
/// settings record(s).
#[uniffi(default = None)]
pub exposure_suggestion_types: Option<Vec<String>>,
}

View File

@@ -5,16 +5,20 @@
use crate::{LabeledTimingSample, Suggestion, SuggestionProvider, SuggestionProviderConstraints};
/// A query for suggestions to show in the address bar.
#[derive(Clone, Debug, Default)]
#[derive(Clone, Debug, Default, uniffi::Record)]
pub struct SuggestionQuery {
pub keyword: String,
pub providers: Vec<SuggestionProvider>,
#[uniffi(default = None)]
pub provider_constraints: Option<SuggestionProviderConstraints>,
#[uniffi(default = None)]
pub limit: Option<i32>,
}
#[derive(uniffi::Record)]
pub struct QueryWithMetricsResult {
pub suggestions: Vec<Suggestion>,
/// Samples for the `suggest.query_time` metric
pub query_times: Vec<LabeledTimingSample>,
}

View File

@@ -34,6 +34,7 @@ use crate::{
///
/// Using a builder is preferred to calling the constructor directly since it's harder to confuse
/// the data_path and cache_path strings.
#[derive(uniffi::Object)]
pub struct SuggestStoreBuilder(Mutex<SuggestStoreBuilderInner>);
#[derive(Default)]
@@ -50,7 +51,9 @@ impl Default for SuggestStoreBuilder {
}
}
#[uniffi::export]
impl SuggestStoreBuilder {
#[uniffi::constructor]
pub fn new() -> SuggestStoreBuilder {
Self(Mutex::new(SuggestStoreBuilderInner::default()))
}
@@ -60,6 +63,7 @@ impl SuggestStoreBuilder {
self
}
/// Deprecated: this is no longer used by the suggest component.
pub fn cache_path(self: Arc<Self>, _path: String) -> Arc<Self> {
// We used to use this, but we're not using it anymore, just ignore the call
self
@@ -75,6 +79,11 @@ impl SuggestStoreBuilder {
self
}
/// Add an sqlite3 extension to load
///
/// library_name should be the name of the library without any extension, for example `libmozsqlite3`.
/// entrypoint should be the entry point, for example `sqlite3_fts5_init`. If `null` (the default)
/// entry point will be used (see https://sqlite.org/loadext.html for details).
pub fn load_extension(
self: Arc<Self>,
library: String,
@@ -109,7 +118,7 @@ impl SuggestStoreBuilder {
}
/// What should be interrupted when [SuggestStore::interrupt] is called?
#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)]
#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash, uniffi::Enum)]
pub enum InterruptKind {
/// Interrupt read operations like [SuggestStore::query]
Read,
@@ -148,13 +157,16 @@ pub enum InterruptKind {
/// to request a small subset of the Suggest data and download the rest
/// later, while a desktop on a fast link might download the entire dataset
/// on the first launch.
#[derive(uniffi::Object)]
pub struct SuggestStore {
inner: SuggestStoreInner<RemoteSettingsClient>,
}
#[uniffi::export]
impl SuggestStore {
/// Creates a Suggest store.
#[handle_error(Error)]
#[uniffi::constructor(default(settings_config = None))]
pub fn new(
path: &str,
settings_config: Option<RemoteSettingsConfig>,
@@ -212,6 +224,7 @@ impl SuggestStore {
/// This should be called when the user types new input into the address
/// bar, to ensure that they see fresh suggestions as they type. This
/// method does not interrupt any ongoing ingests.
#[uniffi::method(default(kind = None))]
pub fn interrupt(&self, kind: Option<InterruptKind>) {
self.inner.interrupt(kind)
}
@@ -245,18 +258,29 @@ impl SuggestStore {
) -> SuggestApiResult<Option<SuggestProviderConfig>> {
self.inner.fetch_provider_config(provider)
}
}
impl SuggestStore {
pub fn force_reingest(&self) {
self.inner.force_reingest()
}
}
/// Constraints limit which suggestions to ingest from Remote Settings.
#[derive(Clone, Default, Debug)]
#[derive(Clone, Default, Debug, uniffi::Record)]
pub struct SuggestIngestionConstraints {
#[uniffi(default = None)]
pub providers: Option<Vec<SuggestionProvider>>,
#[uniffi(default = None)]
pub provider_constraints: Option<SuggestionProviderConstraints>,
/// Only run ingestion if the table `suggestions` is empty
///
// This is indented to handle periodic updates. Consumers can schedule an ingest with
// `empty_only=true` on startup and a regular ingest with `empty_only=false` to run on a long periodic schedule (maybe
// once a day). This allows ingestion to normally be run at a slow, periodic rate. However, if
// there is a schema upgrade that causes the database to be thrown away, then the
// `empty_only=true` ingestion that runs on startup will repopulate it.
#[uniffi(default = false)]
pub empty_only: bool,
}

View File

@@ -1,244 +0,0 @@
/* 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/.
*/
[External="remote_settings"]
typedef extern RemoteSettingsConfig;
[External="remote_settings"]
typedef extern RemoteSettingsServer;
namespace suggest {
boolean raw_suggestion_url_matches([ByRef] string raw_url, [ByRef] string url);
};
[Error]
interface SuggestApiError {
// An operation was interrupted by calling `SuggestStore.interrupt()`
Interrupted();
// The server requested a backoff after too many requests
Backoff(u64 seconds);
Network(string reason);
Other(string reason);
};
enum SuggestionProvider {
"Amp",
"Pocket",
"Wikipedia",
"Amo",
"Yelp",
"Mdn",
"Weather",
"AmpMobile",
"Fakespot",
"Exposure",
};
[Enum]
interface Suggestion {
Amp(
string title,
string url,
string raw_url,
sequence<u8>? icon,
string? icon_mimetype,
string full_keyword,
i64 block_id,
string advertiser,
string iab_category,
string impression_url,
string click_url,
string raw_click_url,
f64 score
);
Pocket(
string title,
string url,
f64 score,
boolean is_top_pick
);
Wikipedia(
string title,
string url,
sequence<u8>? icon,
string? icon_mimetype,
string full_keyword
);
Amo(
string title,
string url,
string icon_url,
string description,
string? rating,
i64 number_of_ratings,
string guid,
f64 score
);
Yelp(
string url,
string title,
sequence<u8>? icon,
string? icon_mimetype,
f64 score,
boolean has_location_sign,
boolean subject_exact_match,
string location_param
);
Mdn(
string title,
string url,
string description,
f64 score
);
Weather(
f64 score
);
Fakespot(
string fakespot_grade,
string product_id,
f64 rating,
string title,
i64 total_reviews,
string url,
sequence<u8>? icon,
string? icon_mimetype,
f64 score
);
Exposure(
string suggestion_type,
f64 score
);
};
dictionary SuggestionQuery {
string keyword;
sequence<SuggestionProvider> providers;
SuggestionProviderConstraints? provider_constraints = null;
i32? limit = null;
};
dictionary SuggestIngestionConstraints {
sequence<SuggestionProvider>? providers = null;
SuggestionProviderConstraints? provider_constraints = null;
// Only ingest if the table `suggestions` is empty.
//
// This is indented to handle periodic updates. Consumers can schedule an ingest with
// `empty_only=true` on startup and a regular ingest with `empty_only=false` to run on a long periodic schedule (maybe
// once a day). This allows ingestion to normally be run at a slow, periodic rate. However, if
// there is a schema upgrade that causes the database to be thrown away, then the
// `empty_only=true` ingestion that runs on startup will repopulate it.
boolean empty_only = false;
};
// Some providers manage multiple suggestion subtypes. Queries, ingests, and
// other operations on those providers must be constrained to a desired subtype.
dictionary SuggestionProviderConstraints {
// `Exposure` provider - For each desired exposure suggestion type, this
// should contain the value of the `suggestion_type` field of its remote
// settings record(s).
sequence<string>? exposure_suggestion_types = null;
};
dictionary SuggestIngestionMetrics {
// Samples for the `suggest.ingestion_time` metric
sequence<LabeledTimingSample> ingestion_times;
// Samples for the `suggest.ingestion_download_time` metric
sequence<LabeledTimingSample> download_times;
};
dictionary QueryWithMetricsResult {
sequence<Suggestion> suggestions;
// Samples for the `suggest.query_time` metric
sequence<LabeledTimingSample> query_times;
};
/// A single sample for a labeled timing distribution metric
dictionary LabeledTimingSample {
string label;
// Time in microseconds
u64 value;
};
dictionary SuggestGlobalConfig {
i32 show_less_frequently_cap;
};
[Enum]
interface SuggestProviderConfig {
Weather(
i32 min_keyword_length
);
};
enum InterruptKind {
"Read",
"Write",
"ReadWrite",
};
interface SuggestStore {
[Throws=SuggestApiError]
constructor([ByRef] string path, optional RemoteSettingsConfig? settings_config = null);
[Throws=SuggestApiError]
sequence<Suggestion> query(SuggestionQuery query);
[Throws=SuggestApiError]
QueryWithMetricsResult query_with_metrics(SuggestionQuery query);
[Throws=SuggestApiError]
void dismiss_suggestion(string raw_suggestion_url);
[Throws=SuggestApiError]
void clear_dismissed_suggestions();
// Interrupt operations
//
// This is optional for backwards compatibility, but this is deprecated. Consumers should
// update their code to pass in a InterruptKind value.
void interrupt(optional InterruptKind? kind = null);
[Throws=SuggestApiError]
SuggestIngestionMetrics ingest(SuggestIngestionConstraints constraints);
[Throws=SuggestApiError]
void clear();
[Throws=SuggestApiError]
SuggestGlobalConfig fetch_global_config();
[Throws=SuggestApiError]
SuggestProviderConfig? fetch_provider_config(SuggestionProvider provider);
};
interface SuggestStoreBuilder {
constructor();
[Self=ByArc]
SuggestStoreBuilder data_path(string path);
// Deprecated: this is no longer used by the suggest component.
[Self=ByArc]
SuggestStoreBuilder cache_path(string path);
[Self=ByArc]
SuggestStoreBuilder remote_settings_server(RemoteSettingsServer server);
[Self=ByArc]
SuggestStoreBuilder remote_settings_bucket_name(string bucket_name);
// Add an sqlite3 extension to load
//
// library_name should be the name of the library without any extension, for example `libmozsqlite3`.
// entrypoint should be the entry point, for example `sqlite3_fts5_init`. If `null` (the default)
// entry point will be used (see https://sqlite.org/loadext.html for details).
[Self=ByArc]
SuggestStoreBuilder load_extension(string library_name, string? entrypoint);
[Throws=SuggestApiError]
SuggestStore build();
};

View File

@@ -22,7 +22,7 @@ pub(crate) enum AmpSuggestionType {
Desktop,
}
/// A suggestion from the database to show in the address bar.
#[derive(Clone, Debug, PartialEq)]
#[derive(Clone, Debug, PartialEq, uniffi::Enum)]
pub enum Suggestion {
Amp {
title: String,
@@ -220,6 +220,7 @@ pub(crate) fn cook_raw_suggestion_url(raw_url: &str) -> String {
/// Determines whether a "raw" sponsored suggestion URL is equivalent to a
/// "cooked" URL. The two URLs are equivalent if they are identical except for
/// their replaced template parameters, which can be different.
#[uniffi::export]
pub fn raw_suggestion_url_matches(raw_url: &str, cooked_url: &str) -> bool {
let Some((raw_url_prefix, raw_url_suffix)) = raw_url.split_once(TIMESTAMP_TEMPLATE) else {
return raw_url == cooked_url;

View File

@@ -1,10 +1,6 @@
[bindings.kotlin]
package_name = "mozilla.appservices.suggest"
cdylib_name = "megazord"
[bindings.kotlin.external_packages]
remote_settings = "mozilla.appservices.remotesettings"
[bindings.swift]
ffi_module_name = "MozillaRustComponents"
ffi_module_filename = "suggestFFI"

View File

@@ -1 +1 @@
{"files":{"Cargo.toml":"a39792d0f4e61aa94915bd5ee9141d76ce3612d2c05829117e2c4187bf8a1138","README.md":"6d4ff5b079ac5340d18fa127f583e7ad793c5a2328b8ecd12c3fc723939804f2","build.rs":"aa971160d67ce8626b26e15c04c34b730f594c45c817aae34cfc9f3ea14ae284","src/bso/content.rs":"92935258745bdf0c3915a555cb6884a7fa69faa1290ec2c1815f6e2f3c0f0562","src/bso/crypto.rs":"27602dcccb37d3a55620ee4e16b705da455d49af575de115c7c79c0178eb1d6d","src/bso/mod.rs":"09e723dc7e99295ecafdcadffaf604d66ea27cf2b7f1fd9ab3cac4f4698ff6a7","src/bso/test_utils.rs":"4ec5a2df5e1c0ec14dc770681e959bdcef6ef04f6fde435999197f46a8ae4831","src/client/coll_state.rs":"13e6ef55273baf5536acc369be522e34a803a32cabf19cce43e426aea9b6223e","src/client/coll_update.rs":"dac04a90c29dd969f8b4250414609c9b6d61daf2dfa4ae77d1c4a165ba970b05","src/client/collection_keys.rs":"c27b2277a3a52033b58ab01490fc2ea7007494195dd5e6dc2c6931a4ca96795a","src/client/mod.rs":"8f588d4a035cf79d96f2500f06d5651c1a7c566127c456ffa5429811ddce3fd6","src/client/request.rs":"e878c5b43298b6eb682748474963f9fb8d053b4dc690bbb27107f5fa0ee74e01","src/client/state.rs":"4e31193ef2471c1dfabf1c6a391bcb95e14ddb45855786a4194ff187d5c9347c","src/client/status.rs":"f445a8765dac9789444e23b5145148413407bb1d18a15ef56682243997f591bf","src/client/storage_client.rs":"cc4a3219f342f8665399734902f68a2ddf12ed7e3726033ed10084bcefb66ffd","src/client/sync.rs":"b29abb512ec9d163f7883b71f78c9202802dcb17cad1fc5dc08087fb0bb66704","src/client/sync_multiple.rs":"6e92571132f89744b553190c596be8aff9b2d031d8f79d82c94cdf78b1683f4a","src/client/token.rs":"13729c693c8be72bcafc816c97e2a35932d008b4f2ccda6a5f8cdb8b2c99a293","src/client/util.rs":"71cc70ee41f821f53078675e636e9fad9c6046fa1a989e37f5487e340a2277d6","src/client_types.rs":"3c3cac1540b92482f43660d9e43bdde8481c4cc1a98253a68c80e791231f5976","src/clients_engine/engine.rs":"9e11b47be81fc63214f31879af74075674aa50a8f8989afe20fefa7990fa99b9","src/clients_engine/mod.rs":"461729e6f89b66b2cbd89b041a03d4d6a8ba582284ed4f3015cb13e1a0c6da97","src/clients_engine/record.rs":"b0d84bf420743d7638a45e4836633a45e50257d5548fe7ecd04bff4d724439b8","src/clients_engine/ser.rs":"be6a19c45eb8002ff8e7cf746d2f97d9cecd1740f9817a8f1d624825475fd777","src/device_type.rs":"dc2d4296d25e31471c8e68488f1043ff239b902036cd6aea8a686cf79b4ed335","src/enc_payload.rs":"aa3eea7df49b24cd59831680a47c417b73a3e36e6b0f3f4baf14ca66bd68be6b","src/engine/bridged_engine.rs":"b4e3071a0259ac55303364e57f9cd685916b80dc302030bba07790e55ceecb66","src/engine/mod.rs":"90f1f9760f5f712a337aebb04e59c736e4b6fbd89d6a188d969210c7f3f321ae","src/engine/request.rs":"5923025fb9550178339f880a1bf8526d8e853e7a0b2bce6d9d687cc808ac0085","src/engine/sync_engine.rs":"531b35d72ce9e04c3e543c0468c1e450fba2c0dc3d33d68d9b1c0a5c1ad7dd34","src/error.rs":"a45cfe02e6301f473c34678b694943c1a04308b8c292c6e0448bf495194c3b5e","src/key_bundle.rs":"abd0781f3be8c8e7c691f18bb71f3433b633803c48da9794e15ac6301ed60d6c","src/lib.rs":"f59f8817978d943518dfa03ab31fc0f6b1fc72ee9943a97aef1537e2769649f5","src/record_types.rs":"02bb3d352fb808131d298f9b90d9c95b7e9e0138b97c5401f3b9fdacc5562f44","src/server_timestamp.rs":"63916817796e83fe31fbd598bac025dfa71ec9e1808d09073db258c78a3331cd","src/sync15.udl":"005b2b056b93c959a04670f6f489afecb8e17093d8e4be34765a3a4cc0faeb8c","src/telemetry.rs":"1d06433aafe05b8d0c403ff6cb3bb35eec292f2cd6273d321eaa196fb6584dd6","uniffi.toml":"34488f947497a9b05007445dd816024ef02e6b1696f1056ee868f039722828ee"},"package":null}
{"files":{"Cargo.toml":"a39792d0f4e61aa94915bd5ee9141d76ce3612d2c05829117e2c4187bf8a1138","README.md":"6d4ff5b079ac5340d18fa127f583e7ad793c5a2328b8ecd12c3fc723939804f2","build.rs":"aa971160d67ce8626b26e15c04c34b730f594c45c817aae34cfc9f3ea14ae284","src/bso/content.rs":"92935258745bdf0c3915a555cb6884a7fa69faa1290ec2c1815f6e2f3c0f0562","src/bso/crypto.rs":"27602dcccb37d3a55620ee4e16b705da455d49af575de115c7c79c0178eb1d6d","src/bso/mod.rs":"09e723dc7e99295ecafdcadffaf604d66ea27cf2b7f1fd9ab3cac4f4698ff6a7","src/bso/test_utils.rs":"4ec5a2df5e1c0ec14dc770681e959bdcef6ef04f6fde435999197f46a8ae4831","src/client/coll_state.rs":"13e6ef55273baf5536acc369be522e34a803a32cabf19cce43e426aea9b6223e","src/client/coll_update.rs":"dac04a90c29dd969f8b4250414609c9b6d61daf2dfa4ae77d1c4a165ba970b05","src/client/collection_keys.rs":"c27b2277a3a52033b58ab01490fc2ea7007494195dd5e6dc2c6931a4ca96795a","src/client/mod.rs":"8f588d4a035cf79d96f2500f06d5651c1a7c566127c456ffa5429811ddce3fd6","src/client/request.rs":"e878c5b43298b6eb682748474963f9fb8d053b4dc690bbb27107f5fa0ee74e01","src/client/state.rs":"4e31193ef2471c1dfabf1c6a391bcb95e14ddb45855786a4194ff187d5c9347c","src/client/status.rs":"f445a8765dac9789444e23b5145148413407bb1d18a15ef56682243997f591bf","src/client/storage_client.rs":"cc4a3219f342f8665399734902f68a2ddf12ed7e3726033ed10084bcefb66ffd","src/client/sync.rs":"b29abb512ec9d163f7883b71f78c9202802dcb17cad1fc5dc08087fb0bb66704","src/client/sync_multiple.rs":"6e92571132f89744b553190c596be8aff9b2d031d8f79d82c94cdf78b1683f4a","src/client/token.rs":"13729c693c8be72bcafc816c97e2a35932d008b4f2ccda6a5f8cdb8b2c99a293","src/client/util.rs":"71cc70ee41f821f53078675e636e9fad9c6046fa1a989e37f5487e340a2277d6","src/client_types.rs":"3c3cac1540b92482f43660d9e43bdde8481c4cc1a98253a68c80e791231f5976","src/clients_engine/engine.rs":"9e11b47be81fc63214f31879af74075674aa50a8f8989afe20fefa7990fa99b9","src/clients_engine/mod.rs":"461729e6f89b66b2cbd89b041a03d4d6a8ba582284ed4f3015cb13e1a0c6da97","src/clients_engine/record.rs":"b0d84bf420743d7638a45e4836633a45e50257d5548fe7ecd04bff4d724439b8","src/clients_engine/ser.rs":"be6a19c45eb8002ff8e7cf746d2f97d9cecd1740f9817a8f1d624825475fd777","src/device_type.rs":"dc2d4296d25e31471c8e68488f1043ff239b902036cd6aea8a686cf79b4ed335","src/enc_payload.rs":"aa3eea7df49b24cd59831680a47c417b73a3e36e6b0f3f4baf14ca66bd68be6b","src/engine/bridged_engine.rs":"b4e3071a0259ac55303364e57f9cd685916b80dc302030bba07790e55ceecb66","src/engine/mod.rs":"90f1f9760f5f712a337aebb04e59c736e4b6fbd89d6a188d969210c7f3f321ae","src/engine/request.rs":"5923025fb9550178339f880a1bf8526d8e853e7a0b2bce6d9d687cc808ac0085","src/engine/sync_engine.rs":"531b35d72ce9e04c3e543c0468c1e450fba2c0dc3d33d68d9b1c0a5c1ad7dd34","src/error.rs":"a45cfe02e6301f473c34678b694943c1a04308b8c292c6e0448bf495194c3b5e","src/key_bundle.rs":"abd0781f3be8c8e7c691f18bb71f3433b633803c48da9794e15ac6301ed60d6c","src/lib.rs":"f59f8817978d943518dfa03ab31fc0f6b1fc72ee9943a97aef1537e2769649f5","src/record_types.rs":"02bb3d352fb808131d298f9b90d9c95b7e9e0138b97c5401f3b9fdacc5562f44","src/server_timestamp.rs":"63916817796e83fe31fbd598bac025dfa71ec9e1808d09073db258c78a3331cd","src/sync15.udl":"464047a67a7877bc671f9f3aca13f3039cf34beb51756bcdb86015d789a8f400","src/telemetry.rs":"1d06433aafe05b8d0c403ff6cb3bb35eec292f2cd6273d321eaa196fb6584dd6","uniffi.toml":"6f0a4f249366afdc2294158a281afa3e0d03ad2ba28001ad5062f6377eaef049"},"package":null}

View File

@@ -2,15 +2,15 @@
// This exists purely to expose types used by other components.
namespace sync15 {
};
// Enumeration for the different types of device.
//
// Firefox Accounts separates devices into broad categories for display purposes,
// such as distinguishing a desktop PC from a mobile phone. Upon signin, the
// application should inspect the device it is running on and select an appropriate
// [`DeviceType`] to include in its device registration record.
//
/// Enumeration for the different types of device.
///
/// Firefox Accounts separates devices into broad categories for display purposes,
/// such as distinguishing a desktop PC from a mobile phone. Upon signin, the
/// application should inspect the device it is running on and select an appropriate
/// [`DeviceType`] to include in its device registration record.
enum DeviceType {
"Desktop",
"Mobile",

View File

@@ -1,6 +1,5 @@
[bindings.kotlin]
package_name = "mozilla.appservices.sync15"
cdylib_name = "megazord"
[bindings.swift]
ffi_module_name = "MozillaRustComponents"

View File

@@ -1 +1 @@
{"files":{"Cargo.toml":"0f616e50dcb30105924bf243bd0a59ff50def3a4765ea49d85aadde21d5fdca0","README.md":"c48b8f391ef822c4f3971b5f453a1e7b43bea232752d520460d2f04803aead1a","build.rs":"33e61b811b19ed2b58e319cc65d5988bed258d2c4fea2d706301184c59847a0f","src/error.rs":"c38755d7db591c95ee5f0f14d8e8fbea4e8cfc63cf979cd9a1fed2b13e275a6a","src/lib.rs":"5789fc7107c76168c331c175aff4f0b2ac2ba3d65cfa0df0e1d4f8ef0c6eb80c","src/schema.rs":"510218d465c7d26d6b9f342cc33c14ab83044a67561ef924c33dadb060761972","src/storage.rs":"47a9f7c17d1164c365f2fd97a7693c935d6f448b1491977fc07913c2d1fd98ad","src/store.rs":"30d854aa7ad1ee3a3cac683a1ae0b9fb3833c8d90537beafcd3e4b24f6e7c6e8","src/sync/bridge.rs":"18d3a7913a030b598d4b6cbd5b7e2ab4cef4cc7ea964f5bc84d7fb2f28787529","src/sync/engine.rs":"73007423f2a22314a034ac660aa65bd9c50e8aa850c445a66604486280067843","src/sync/mod.rs":"09ba3c87f1174a243bf5aaa481effd18929d54359ceb9b23ccb2c32ee3482f34","src/sync/record.rs":"eef6751c209d039958afbe245ddb006cfdf6b8b6b47f925f69c552b832b87922","src/tabs.udl":"4a041d365c0e177481c2848104196017d754793da22e650ad71869e209b42500","uniffi.toml":"f9125e8d55b109e86076ee88bfd640372f06b142b7db557e41816c7227dd445c"},"package":null}
{"files":{"Cargo.toml":"0f616e50dcb30105924bf243bd0a59ff50def3a4765ea49d85aadde21d5fdca0","README.md":"c48b8f391ef822c4f3971b5f453a1e7b43bea232752d520460d2f04803aead1a","build.rs":"33e61b811b19ed2b58e319cc65d5988bed258d2c4fea2d706301184c59847a0f","src/error.rs":"c38755d7db591c95ee5f0f14d8e8fbea4e8cfc63cf979cd9a1fed2b13e275a6a","src/lib.rs":"5789fc7107c76168c331c175aff4f0b2ac2ba3d65cfa0df0e1d4f8ef0c6eb80c","src/schema.rs":"510218d465c7d26d6b9f342cc33c14ab83044a67561ef924c33dadb060761972","src/storage.rs":"47a9f7c17d1164c365f2fd97a7693c935d6f448b1491977fc07913c2d1fd98ad","src/store.rs":"30d854aa7ad1ee3a3cac683a1ae0b9fb3833c8d90537beafcd3e4b24f6e7c6e8","src/sync/bridge.rs":"18d3a7913a030b598d4b6cbd5b7e2ab4cef4cc7ea964f5bc84d7fb2f28787529","src/sync/engine.rs":"73007423f2a22314a034ac660aa65bd9c50e8aa850c445a66604486280067843","src/sync/mod.rs":"09ba3c87f1174a243bf5aaa481effd18929d54359ceb9b23ccb2c32ee3482f34","src/sync/record.rs":"eef6751c209d039958afbe245ddb006cfdf6b8b6b47f925f69c552b832b87922","src/tabs.udl":"99322a1d49d82fb436a279431f407f5b09c9d277e238a7d6fb270a744ec466af","uniffi.toml":"9c25731a643df2f72aff7fc69c2d92a3a1ee0df02e0533c9e24def168efef012"},"package":null}

View File

@@ -44,7 +44,7 @@ dictionary RemoteTabRecord {
string title;
sequence<string> url_history;
string? icon;
// Number of ms since the unix epoch (as reported by the client's clock)
/// Number of ms since the unix epoch (as reported by the client's clock)
i64 last_used;
boolean inactive = false;
};
@@ -53,7 +53,7 @@ dictionary ClientRemoteTabs {
string client_id;
string client_name;
DeviceType device_type;
// Number of ms since the unix epoch (as reported by the server's clock)
/// Number of ms since the unix epoch (as reported by the server's clock)
i64 last_modified;
sequence<RemoteTabRecord> remote_tabs;
};
@@ -96,11 +96,11 @@ dictionary PendingCommand {
Timestamp? time_sent;
};
// Note the canonical docs for this are in https://searchfox.org/mozilla-central/source/services/interfaces/mozIBridgedSyncEngine.idl
// It's only actually used in desktop, but it's fine to expose this everywhere.
// NOTE: all timestamps here are milliseconds.
/// Note the canonical docs for this are in https://searchfox.org/mozilla-central/source/services/interfaces/mozIBridgedSyncEngine.idl
/// It's only actually used in desktop, but it's fine to expose this everywhere.
/// NOTE: all timestamps here are milliseconds.
interface TabsBridgedEngine {
//readonly attribute long storageVersion;
// readonly attribute long storageVersion;
// readonly attribute boolean allowSkippedRecord;
// XXX - better logging story than this?

View File

@@ -1,10 +1,5 @@
[bindings.kotlin]
package_name = "mozilla.appservices.remotetabs"
cdylib_name = "megazord"
[bindings.kotlin.external_packages]
# Map from [External={crate-name}] into Kotlin package names
sync15 = "mozilla.appservices.sync15"
[bindings.swift]
ffi_module_name = "MozillaRustComponents"

View File

@@ -154,6 +154,20 @@ class ArrayBufferDataStream {
return value;
}
readBytes() {
const size = this.readInt32();
const bytes = new Uint8Array(this.dataView.buffer, this.pos, size);
this.pos += size;
return bytes
}
writeBytes(uint8Array) {
this.writeUint32(uint8Array.length);
value.forEach((elt) => {
dataStream.writeUint8(elt);
})
}
// Reads a RelevancyStore pointer from the data stream
// UniFFI Pointers are **always** 8 bytes long. That is enforced
// by the C++ and Rust Scaffolding code.
@@ -268,6 +282,25 @@ export class FfiConverterU32 extends FfiConverter {
}
}
// Export the FFIConverter object to make external types work.
export class FfiConverterF64 extends FfiConverter {
static computeSize() {
return 8;
}
static lift(value) {
return value;
}
static lower(value) {
return value;
}
static write(dataStream, value) {
dataStream.writeFloat64(value)
}
static read(dataStream) {
return dataStream.readFloat64()
}
}
// Export the FFIConverter object to make external types work.
export class FfiConverterString extends FfiConverter {
static checkType(value) {
@@ -319,21 +352,21 @@ export class RelevancyStore {
*
* @returns { RelevancyStore }
*/
static init(dbpath) {
static init(dbPath) {
const liftResult = (result) => FfiConverterTypeRelevancyStore.lift(result);
const liftError = null;
const functionCall = () => {
try {
FfiConverterString.checkType(dbpath)
FfiConverterString.checkType(dbPath)
} catch (e) {
if (e instanceof UniFFITypeError) {
e.addItemDescriptionPart("dbpath");
e.addItemDescriptionPart("dbPath");
}
throw e;
}
return UniFFIScaffolding.callSync(
5, // relevancy:uniffi_relevancy_fn_constructor_relevancystore_new
FfiConverterString.lower(dbpath),
6, // relevancy:uniffi_relevancy_fn_constructor_relevancystore_new
FfiConverterString.lower(dbPath),
)
}
return handleRustResult(functionCall(), liftResult, liftError);}
@@ -343,7 +376,7 @@ export class RelevancyStore {
const liftError = (data) => FfiConverterTypeRelevancyApiError.lift(data);
const functionCall = () => {
return UniFFIScaffolding.callAsync(
0, // relevancy:uniffi_relevancy_fn_method_relevancystore_calculate_metrics
1, // relevancy:uniffi_relevancy_fn_method_relevancystore_calculate_metrics
FfiConverterTypeRelevancyStore.lower(this),
)
}
@@ -359,29 +392,29 @@ export class RelevancyStore {
const liftError = null;
const functionCall = () => {
return UniFFIScaffolding.callSync(
1, // relevancy:uniffi_relevancy_fn_method_relevancystore_close
2, // relevancy:uniffi_relevancy_fn_method_relevancystore_close
FfiConverterTypeRelevancyStore.lower(this),
)
}
return handleRustResult(functionCall(), liftResult, liftError);
}
ingest(topUrls) {
ingest(topUrlsByFrecency) {
const liftResult = (result) => FfiConverterTypeInterestVector.lift(result);
const liftError = (data) => FfiConverterTypeRelevancyApiError.lift(data);
const functionCall = () => {
try {
FfiConverterSequencestring.checkType(topUrls)
FfiConverterSequencestring.checkType(topUrlsByFrecency)
} catch (e) {
if (e instanceof UniFFITypeError) {
e.addItemDescriptionPart("topUrls");
e.addItemDescriptionPart("topUrlsByFrecency");
}
throw e;
}
return UniFFIScaffolding.callAsync(
2, // relevancy:uniffi_relevancy_fn_method_relevancystore_ingest
3, // relevancy:uniffi_relevancy_fn_method_relevancystore_ingest
FfiConverterTypeRelevancyStore.lower(this),
FfiConverterSequencestring.lower(topUrls),
FfiConverterSequencestring.lower(topUrlsByFrecency),
)
}
try {
@@ -396,7 +429,7 @@ export class RelevancyStore {
const liftError = null;
const functionCall = () => {
return UniFFIScaffolding.callSync(
3, // relevancy:uniffi_relevancy_fn_method_relevancystore_interrupt
4, // relevancy:uniffi_relevancy_fn_method_relevancystore_interrupt
FfiConverterTypeRelevancyStore.lower(this),
)
}
@@ -408,7 +441,7 @@ export class RelevancyStore {
const liftError = (data) => FfiConverterTypeRelevancyApiError.lift(data);
const functionCall = () => {
return UniFFIScaffolding.callAsync(
4, // relevancy:uniffi_relevancy_fn_method_relevancystore_user_interest_vector
5, // relevancy:uniffi_relevancy_fn_method_relevancystore_user_interest_vector
FfiConverterTypeRelevancyStore.lower(this),
)
}
@@ -545,7 +578,15 @@ export class FfiConverterTypeInterestMetrics extends FfiConverterArrayBuffer {
}
export class InterestVector {
constructor({ animals, arts, autos, business, career, education, fashion, finance, food, government, hobbies, home, news, realEstate, society, sports, tech, travel, inconclusive } = {}) {
constructor({ inconclusive, animals, arts, autos, business, career, education, fashion, finance, food, government, hobbies, home, news, realEstate, society, sports, tech, travel } = {}) {
try {
FfiConverterU32.checkType(inconclusive)
} catch (e) {
if (e instanceof UniFFITypeError) {
e.addItemDescriptionPart("inconclusive");
}
throw e;
}
try {
FfiConverterU32.checkType(animals)
} catch (e) {
@@ -690,14 +731,7 @@ export class InterestVector {
}
throw e;
}
try {
FfiConverterU32.checkType(inconclusive)
} catch (e) {
if (e instanceof UniFFITypeError) {
e.addItemDescriptionPart("inconclusive");
}
throw e;
}
this.inconclusive = inconclusive;
this.animals = animals;
this.arts = arts;
this.autos = autos;
@@ -716,10 +750,10 @@ export class InterestVector {
this.sports = sports;
this.tech = tech;
this.travel = travel;
this.inconclusive = inconclusive;
}
equals(other) {
return (
this.inconclusive == other.inconclusive &&
this.animals == other.animals &&
this.arts == other.arts &&
this.autos == other.autos &&
@@ -737,8 +771,7 @@ export class InterestVector {
this.society == other.society &&
this.sports == other.sports &&
this.tech == other.tech &&
this.travel == other.travel &&
this.inconclusive == other.inconclusive
this.travel == other.travel
)
}
}
@@ -747,6 +780,7 @@ export class InterestVector {
export class FfiConverterTypeInterestVector extends FfiConverterArrayBuffer {
static read(dataStream) {
return new InterestVector({
inconclusive: FfiConverterU32.read(dataStream),
animals: FfiConverterU32.read(dataStream),
arts: FfiConverterU32.read(dataStream),
autos: FfiConverterU32.read(dataStream),
@@ -765,10 +799,10 @@ export class FfiConverterTypeInterestVector extends FfiConverterArrayBuffer {
sports: FfiConverterU32.read(dataStream),
tech: FfiConverterU32.read(dataStream),
travel: FfiConverterU32.read(dataStream),
inconclusive: FfiConverterU32.read(dataStream),
});
}
static write(dataStream, value) {
FfiConverterU32.write(dataStream, value.inconclusive);
FfiConverterU32.write(dataStream, value.animals);
FfiConverterU32.write(dataStream, value.arts);
FfiConverterU32.write(dataStream, value.autos);
@@ -787,11 +821,11 @@ export class FfiConverterTypeInterestVector extends FfiConverterArrayBuffer {
FfiConverterU32.write(dataStream, value.sports);
FfiConverterU32.write(dataStream, value.tech);
FfiConverterU32.write(dataStream, value.travel);
FfiConverterU32.write(dataStream, value.inconclusive);
}
static computeSize(value) {
let totalSize = 0;
totalSize += FfiConverterU32.computeSize(value.inconclusive);
totalSize += FfiConverterU32.computeSize(value.animals);
totalSize += FfiConverterU32.computeSize(value.arts);
totalSize += FfiConverterU32.computeSize(value.autos);
@@ -810,7 +844,6 @@ export class FfiConverterTypeInterestVector extends FfiConverterArrayBuffer {
totalSize += FfiConverterU32.computeSize(value.sports);
totalSize += FfiConverterU32.computeSize(value.tech);
totalSize += FfiConverterU32.computeSize(value.travel);
totalSize += FfiConverterU32.computeSize(value.inconclusive);
return totalSize
}
@@ -819,6 +852,14 @@ export class FfiConverterTypeInterestVector extends FfiConverterArrayBuffer {
if (!(value instanceof InterestVector)) {
throw new UniFFITypeError(`Expected 'InterestVector', found '${typeof value}'`);
}
try {
FfiConverterU32.checkType(value.inconclusive);
} catch (e) {
if (e instanceof UniFFITypeError) {
e.addItemDescriptionPart(".inconclusive");
}
throw e;
}
try {
FfiConverterU32.checkType(value.animals);
} catch (e) {
@@ -963,38 +1004,30 @@ export class FfiConverterTypeInterestVector extends FfiConverterArrayBuffer {
}
throw e;
}
try {
FfiConverterU32.checkType(value.inconclusive);
} catch (e) {
if (e instanceof UniFFITypeError) {
e.addItemDescriptionPart(".inconclusive");
}
throw e;
}
}
}
export const Interest = {
ANIMALS: 1,
ARTS: 2,
AUTOS: 3,
BUSINESS: 4,
CAREER: 5,
EDUCATION: 6,
FASHION: 7,
FINANCE: 8,
FOOD: 9,
GOVERNMENT: 10,
HOBBIES: 11,
HOME: 12,
NEWS: 13,
REAL_ESTATE: 14,
SOCIETY: 15,
SPORTS: 16,
TECH: 17,
TRAVEL: 18,
INCONCLUSIVE: 19,
INCONCLUSIVE: 1,
ANIMALS: 2,
ARTS: 3,
AUTOS: 4,
BUSINESS: 5,
CAREER: 6,
EDUCATION: 7,
FASHION: 8,
FINANCE: 9,
FOOD: 10,
GOVERNMENT: 11,
HOBBIES: 12,
HOME: 13,
NEWS: 14,
REAL_ESTATE: 15,
SOCIETY: 16,
SPORTS: 17,
TECH: 18,
TRAVEL: 19,
};
Object.freeze(Interest);
@@ -1003,122 +1036,122 @@ export class FfiConverterTypeInterest extends FfiConverterArrayBuffer {
static read(dataStream) {
switch (dataStream.readInt32()) {
case 1:
return Interest.ANIMALS
case 2:
return Interest.ARTS
case 3:
return Interest.AUTOS
case 4:
return Interest.BUSINESS
case 5:
return Interest.CAREER
case 6:
return Interest.EDUCATION
case 7:
return Interest.FASHION
case 8:
return Interest.FINANCE
case 9:
return Interest.FOOD
case 10:
return Interest.GOVERNMENT
case 11:
return Interest.HOBBIES
case 12:
return Interest.HOME
case 13:
return Interest.NEWS
case 14:
return Interest.REAL_ESTATE
case 15:
return Interest.SOCIETY
case 16:
return Interest.SPORTS
case 17:
return Interest.TECH
case 18:
return Interest.TRAVEL
case 19:
return Interest.INCONCLUSIVE
case 2:
return Interest.ANIMALS
case 3:
return Interest.ARTS
case 4:
return Interest.AUTOS
case 5:
return Interest.BUSINESS
case 6:
return Interest.CAREER
case 7:
return Interest.EDUCATION
case 8:
return Interest.FASHION
case 9:
return Interest.FINANCE
case 10:
return Interest.FOOD
case 11:
return Interest.GOVERNMENT
case 12:
return Interest.HOBBIES
case 13:
return Interest.HOME
case 14:
return Interest.NEWS
case 15:
return Interest.REAL_ESTATE
case 16:
return Interest.SOCIETY
case 17:
return Interest.SPORTS
case 18:
return Interest.TECH
case 19:
return Interest.TRAVEL
default:
throw new UniFFITypeError("Unknown Interest variant");
}
}
static write(dataStream, value) {
if (value === Interest.ANIMALS) {
if (value === Interest.INCONCLUSIVE) {
dataStream.writeInt32(1);
return;
}
if (value === Interest.ARTS) {
if (value === Interest.ANIMALS) {
dataStream.writeInt32(2);
return;
}
if (value === Interest.AUTOS) {
if (value === Interest.ARTS) {
dataStream.writeInt32(3);
return;
}
if (value === Interest.BUSINESS) {
if (value === Interest.AUTOS) {
dataStream.writeInt32(4);
return;
}
if (value === Interest.CAREER) {
if (value === Interest.BUSINESS) {
dataStream.writeInt32(5);
return;
}
if (value === Interest.EDUCATION) {
if (value === Interest.CAREER) {
dataStream.writeInt32(6);
return;
}
if (value === Interest.FASHION) {
if (value === Interest.EDUCATION) {
dataStream.writeInt32(7);
return;
}
if (value === Interest.FINANCE) {
if (value === Interest.FASHION) {
dataStream.writeInt32(8);
return;
}
if (value === Interest.FOOD) {
if (value === Interest.FINANCE) {
dataStream.writeInt32(9);
return;
}
if (value === Interest.GOVERNMENT) {
if (value === Interest.FOOD) {
dataStream.writeInt32(10);
return;
}
if (value === Interest.HOBBIES) {
if (value === Interest.GOVERNMENT) {
dataStream.writeInt32(11);
return;
}
if (value === Interest.HOME) {
if (value === Interest.HOBBIES) {
dataStream.writeInt32(12);
return;
}
if (value === Interest.NEWS) {
if (value === Interest.HOME) {
dataStream.writeInt32(13);
return;
}
if (value === Interest.REAL_ESTATE) {
if (value === Interest.NEWS) {
dataStream.writeInt32(14);
return;
}
if (value === Interest.SOCIETY) {
if (value === Interest.REAL_ESTATE) {
dataStream.writeInt32(15);
return;
}
if (value === Interest.SPORTS) {
if (value === Interest.SOCIETY) {
dataStream.writeInt32(16);
return;
}
if (value === Interest.TECH) {
if (value === Interest.SPORTS) {
dataStream.writeInt32(17);
return;
}
if (value === Interest.TRAVEL) {
if (value === Interest.TECH) {
dataStream.writeInt32(18);
return;
}
if (value === Interest.INCONCLUSIVE) {
if (value === Interest.TRAVEL) {
dataStream.writeInt32(19);
return;
}
@@ -1235,6 +1268,84 @@ export class FfiConverterSequencestring extends FfiConverterArrayBuffer {
}
}
// Export the FFIConverter object to make external types work.
export class FfiConverterSequenceTypeInterest extends FfiConverterArrayBuffer {
static read(dataStream) {
const len = dataStream.readInt32();
const arr = [];
for (let i = 0; i < len; i++) {
arr.push(FfiConverterTypeInterest.read(dataStream));
}
return arr;
}
static write(dataStream, value) {
dataStream.writeInt32(value.length);
value.forEach((innerValue) => {
FfiConverterTypeInterest.write(dataStream, innerValue);
})
}
static computeSize(value) {
// The size of the length
let size = 4;
for (const innerValue of value) {
size += FfiConverterTypeInterest.computeSize(innerValue);
}
return size;
}
static checkType(value) {
if (!Array.isArray(value)) {
throw new UniFFITypeError(`${value} is not an array`);
}
value.forEach((innerValue, idx) => {
try {
FfiConverterTypeInterest.checkType(innerValue);
} catch (e) {
if (e instanceof UniFFITypeError) {
e.addItemDescriptionPart(`[${idx}]`);
}
throw e;
}
})
}
}
export function score(interestVector,contentCategories) {
const liftResult = (result) => FfiConverterF64.lift(result);
const liftError = null;
const functionCall = () => {
try {
FfiConverterTypeInterestVector.checkType(interestVector)
} catch (e) {
if (e instanceof UniFFITypeError) {
e.addItemDescriptionPart("interestVector");
}
throw e;
}
try {
FfiConverterSequenceTypeInterest.checkType(contentCategories)
} catch (e) {
if (e instanceof UniFFITypeError) {
e.addItemDescriptionPart("contentCategories");
}
throw e;
}
return UniFFIScaffolding.callAsync(
0, // relevancy:uniffi_relevancy_fn_func_score
FfiConverterTypeInterestVector.lower(interestVector),
FfiConverterSequenceTypeInterest.lower(contentCategories),
)
}
try {
return functionCall().then((result) => handleRustResult(result, liftResult, liftError));
} catch (error) {
return Promise.reject(error)
}
}

View File

@@ -154,6 +154,20 @@ class ArrayBufferDataStream {
return value;
}
readBytes() {
const size = this.readInt32();
const bytes = new Uint8Array(this.dataView.buffer, this.pos, size);
this.pos += size;
return bytes
}
writeBytes(uint8Array) {
this.writeUint32(uint8Array.length);
value.forEach((elt) => {
dataStream.writeUint8(elt);
})
}
// Reads a RemoteSettings pointer from the data stream
// UniFFI Pointers are **always** 8 bytes long. That is enforced
// by the C++ and Rust Scaffolding code.
@@ -355,7 +369,7 @@ export class RemoteSettings {
throw e;
}
return UniFFIScaffolding.callSync(
9, // remote_settings:uniffi_remote_settings_fn_constructor_remotesettings_new
10, // remote_settings:uniffi_remote_settings_fn_constructor_remotesettings_new
FfiConverterTypeRemoteSettingsConfig.lower(remoteSettingsConfig),
)
}
@@ -382,7 +396,7 @@ export class RemoteSettings {
throw e;
}
return UniFFIScaffolding.callAsync(
6, // remote_settings:uniffi_remote_settings_fn_method_remotesettings_download_attachment_to_path
7, // remote_settings:uniffi_remote_settings_fn_method_remotesettings_download_attachment_to_path
FfiConverterTypeRemoteSettings.lower(this),
FfiConverterString.lower(attachmentId),
FfiConverterString.lower(path),
@@ -400,7 +414,7 @@ export class RemoteSettings {
const liftError = (data) => FfiConverterTypeRemoteSettingsError.lift(data);
const functionCall = () => {
return UniFFIScaffolding.callAsync(
7, // remote_settings:uniffi_remote_settings_fn_method_remotesettings_get_records
8, // remote_settings:uniffi_remote_settings_fn_method_remotesettings_get_records
FfiConverterTypeRemoteSettings.lower(this),
)
}
@@ -424,7 +438,7 @@ export class RemoteSettings {
throw e;
}
return UniFFIScaffolding.callAsync(
8, // remote_settings:uniffi_remote_settings_fn_method_remotesettings_get_records_since
9, // remote_settings:uniffi_remote_settings_fn_method_remotesettings_get_records_since
FfiConverterTypeRemoteSettings.lower(this),
FfiConverterU64.lower(timestamp),
)

View File

@@ -154,6 +154,20 @@ class ArrayBufferDataStream {
return value;
}
readBytes() {
const size = this.readInt32();
const bytes = new Uint8Array(this.dataView.buffer, this.pos, size);
this.pos += size;
return bytes
}
writeBytes(uint8Array) {
this.writeUint32(uint8Array.length);
value.forEach((elt) => {
dataStream.writeUint8(elt);
})
}
// Reads a SuggestStore pointer from the data stream
// UniFFI Pointers are **always** 8 bytes long. That is enforced
// by the C++ and Rust Scaffolding code.
@@ -260,34 +274,6 @@ const uniffiObjectPtr = Symbol("uniffiObjectPtr");
const constructUniffiObject = Symbol("constructUniffiObject");
UnitTestObjs.uniffiObjectPtr = uniffiObjectPtr;
// Export the FFIConverter object to make external types work.
export class FfiConverterU8 extends FfiConverter {
static checkType(value) {
super.checkType(value);
if (!Number.isInteger(value)) {
throw new UniFFITypeError(`${value} is not an integer`);
}
if (value < 0 || value > 256) {
throw new UniFFITypeError(`${value} exceeds the U8 bounds`);
}
}
static computeSize() {
return 1;
}
static lift(value) {
return value;
}
static lower(value) {
return value;
}
static write(dataStream, value) {
dataStream.writeUint8(value)
}
static read(dataStream) {
return dataStream.readUint8()
}
}
// Export the FFIConverter object to make external types work.
export class FfiConverterI32 extends FfiConverter {
static checkType(value) {
@@ -444,6 +430,28 @@ export class FfiConverterString extends FfiConverter {
}
}
// Export the FFIConverter object to make external types work.
export class FfiConverterBytes extends FfiConverterArrayBuffer {
static read(dataStream) {
return dataStream.readBytes()
}
static write(dataStream, value) {
dataStream.writeBytes(value)
}
static computeSize(value) {
// The size of the length + 1 byte / item
return 4 + value.length
}
static checkType(value) {
if (!value instanceof Uint8Array) {
throw new UniFFITypeError(`${value} is not an Uint8Array`);
}
}
}
export class SuggestStore {
// Use `init` to instantiate this class.
// DO NOT USE THIS CONSTRUCTOR DIRECTLY
@@ -483,7 +491,7 @@ export class SuggestStore {
throw e;
}
return UniFFIScaffolding.callSync(
20, // suggest:uniffi_suggest_fn_constructor_suggeststore_new
21, // suggest:uniffi_suggest_fn_constructor_suggeststore_new
FfiConverterString.lower(path),
FfiConverterOptionalTypeRemoteSettingsConfig.lower(settingsConfig),
)
@@ -495,7 +503,7 @@ export class SuggestStore {
const liftError = (data) => FfiConverterTypeSuggestApiError.lift(data);
const functionCall = () => {
return UniFFIScaffolding.callAsync(
11, // suggest:uniffi_suggest_fn_method_suggeststore_clear
12, // suggest:uniffi_suggest_fn_method_suggeststore_clear
FfiConverterTypeSuggestStore.lower(this),
)
}
@@ -511,7 +519,7 @@ export class SuggestStore {
const liftError = (data) => FfiConverterTypeSuggestApiError.lift(data);
const functionCall = () => {
return UniFFIScaffolding.callAsync(
12, // suggest:uniffi_suggest_fn_method_suggeststore_clear_dismissed_suggestions
13, // suggest:uniffi_suggest_fn_method_suggeststore_clear_dismissed_suggestions
FfiConverterTypeSuggestStore.lower(this),
)
}
@@ -522,22 +530,22 @@ export class SuggestStore {
}
}
dismissSuggestion(rawSuggestionUrl) {
dismissSuggestion(suggestionUrl) {
const liftResult = (result) => undefined;
const liftError = (data) => FfiConverterTypeSuggestApiError.lift(data);
const functionCall = () => {
try {
FfiConverterString.checkType(rawSuggestionUrl)
FfiConverterString.checkType(suggestionUrl)
} catch (e) {
if (e instanceof UniFFITypeError) {
e.addItemDescriptionPart("rawSuggestionUrl");
e.addItemDescriptionPart("suggestionUrl");
}
throw e;
}
return UniFFIScaffolding.callAsync(
13, // suggest:uniffi_suggest_fn_method_suggeststore_dismiss_suggestion
14, // suggest:uniffi_suggest_fn_method_suggeststore_dismiss_suggestion
FfiConverterTypeSuggestStore.lower(this),
FfiConverterString.lower(rawSuggestionUrl),
FfiConverterString.lower(suggestionUrl),
)
}
try {
@@ -552,7 +560,7 @@ export class SuggestStore {
const liftError = (data) => FfiConverterTypeSuggestApiError.lift(data);
const functionCall = () => {
return UniFFIScaffolding.callAsync(
14, // suggest:uniffi_suggest_fn_method_suggeststore_fetch_global_config
15, // suggest:uniffi_suggest_fn_method_suggeststore_fetch_global_config
FfiConverterTypeSuggestStore.lower(this),
)
}
@@ -576,7 +584,7 @@ export class SuggestStore {
throw e;
}
return UniFFIScaffolding.callAsync(
15, // suggest:uniffi_suggest_fn_method_suggeststore_fetch_provider_config
16, // suggest:uniffi_suggest_fn_method_suggeststore_fetch_provider_config
FfiConverterTypeSuggestStore.lower(this),
FfiConverterTypeSuggestionProvider.lower(provider),
)
@@ -601,7 +609,7 @@ export class SuggestStore {
throw e;
}
return UniFFIScaffolding.callAsync(
16, // suggest:uniffi_suggest_fn_method_suggeststore_ingest
17, // suggest:uniffi_suggest_fn_method_suggeststore_ingest
FfiConverterTypeSuggestStore.lower(this),
FfiConverterTypeSuggestIngestionConstraints.lower(constraints),
)
@@ -626,7 +634,7 @@ export class SuggestStore {
throw e;
}
return UniFFIScaffolding.callSync(
17, // suggest:uniffi_suggest_fn_method_suggeststore_interrupt
18, // suggest:uniffi_suggest_fn_method_suggeststore_interrupt
FfiConverterTypeSuggestStore.lower(this),
FfiConverterOptionalTypeInterruptKind.lower(kind),
)
@@ -647,7 +655,7 @@ export class SuggestStore {
throw e;
}
return UniFFIScaffolding.callAsync(
18, // suggest:uniffi_suggest_fn_method_suggeststore_query
19, // suggest:uniffi_suggest_fn_method_suggeststore_query
FfiConverterTypeSuggestStore.lower(this),
FfiConverterTypeSuggestionQuery.lower(query),
)
@@ -672,7 +680,7 @@ export class SuggestStore {
throw e;
}
return UniFFIScaffolding.callAsync(
19, // suggest:uniffi_suggest_fn_method_suggeststore_query_with_metrics
20, // suggest:uniffi_suggest_fn_method_suggeststore_query_with_metrics
FfiConverterTypeSuggestStore.lower(this),
FfiConverterTypeSuggestionQuery.lower(query),
)
@@ -738,7 +746,7 @@ export class SuggestStoreBuilder {
const liftError = null;
const functionCall = () => {
return UniFFIScaffolding.callSync(
27, // suggest:uniffi_suggest_fn_constructor_suggeststorebuilder_new
28, // suggest:uniffi_suggest_fn_constructor_suggeststorebuilder_new
)
}
return handleRustResult(functionCall(), liftResult, liftError);}
@@ -748,7 +756,7 @@ export class SuggestStoreBuilder {
const liftError = (data) => FfiConverterTypeSuggestApiError.lift(data);
const functionCall = () => {
return UniFFIScaffolding.callSync(
21, // suggest:uniffi_suggest_fn_method_suggeststorebuilder_build
22, // suggest:uniffi_suggest_fn_method_suggeststorebuilder_build
FfiConverterTypeSuggestStoreBuilder.lower(this),
)
}
@@ -768,7 +776,7 @@ export class SuggestStoreBuilder {
throw e;
}
return UniFFIScaffolding.callAsync(
22, // suggest:uniffi_suggest_fn_method_suggeststorebuilder_cache_path
23, // suggest:uniffi_suggest_fn_method_suggeststorebuilder_cache_path
FfiConverterTypeSuggestStoreBuilder.lower(this),
FfiConverterString.lower(path),
)
@@ -793,7 +801,7 @@ export class SuggestStoreBuilder {
throw e;
}
return UniFFIScaffolding.callSync(
23, // suggest:uniffi_suggest_fn_method_suggeststorebuilder_data_path
24, // suggest:uniffi_suggest_fn_method_suggeststorebuilder_data_path
FfiConverterTypeSuggestStoreBuilder.lower(this),
FfiConverterString.lower(path),
)
@@ -801,31 +809,31 @@ export class SuggestStoreBuilder {
return handleRustResult(functionCall(), liftResult, liftError);
}
loadExtension(libraryName,entrypoint) {
loadExtension(library,entryPoint) {
const liftResult = (result) => FfiConverterTypeSuggestStoreBuilder.lift(result);
const liftError = null;
const functionCall = () => {
try {
FfiConverterString.checkType(libraryName)
FfiConverterString.checkType(library)
} catch (e) {
if (e instanceof UniFFITypeError) {
e.addItemDescriptionPart("libraryName");
e.addItemDescriptionPart("library");
}
throw e;
}
try {
FfiConverterOptionalstring.checkType(entrypoint)
FfiConverterOptionalstring.checkType(entryPoint)
} catch (e) {
if (e instanceof UniFFITypeError) {
e.addItemDescriptionPart("entrypoint");
e.addItemDescriptionPart("entryPoint");
}
throw e;
}
return UniFFIScaffolding.callSync(
24, // suggest:uniffi_suggest_fn_method_suggeststorebuilder_load_extension
25, // suggest:uniffi_suggest_fn_method_suggeststorebuilder_load_extension
FfiConverterTypeSuggestStoreBuilder.lower(this),
FfiConverterString.lower(libraryName),
FfiConverterOptionalstring.lower(entrypoint),
FfiConverterString.lower(library),
FfiConverterOptionalstring.lower(entryPoint),
)
}
return handleRustResult(functionCall(), liftResult, liftError);
@@ -844,7 +852,7 @@ export class SuggestStoreBuilder {
throw e;
}
return UniFFIScaffolding.callSync(
25, // suggest:uniffi_suggest_fn_method_suggeststorebuilder_remote_settings_bucket_name
26, // suggest:uniffi_suggest_fn_method_suggeststorebuilder_remote_settings_bucket_name
FfiConverterTypeSuggestStoreBuilder.lower(this),
FfiConverterString.lower(bucketName),
)
@@ -865,7 +873,7 @@ export class SuggestStoreBuilder {
throw e;
}
return UniFFIScaffolding.callSync(
26, // suggest:uniffi_suggest_fn_method_suggeststorebuilder_remote_settings_server
27, // suggest:uniffi_suggest_fn_method_suggeststorebuilder_remote_settings_server
FfiConverterTypeSuggestStoreBuilder.lower(this),
FfiConverterTypeRemoteSettingsServer.lower(server),
)
@@ -1493,15 +1501,18 @@ export class FfiConverterTypeInterruptKind extends FfiConverterArrayBuffer {
export class SuggestApiError extends Error {}
export class Interrupted extends SuggestApiError {
export class Network extends SuggestApiError {
constructor(
reason,
...params
) {
super(...params);
const message = `reason: ${ reason }`;
super(message, ...params);
this.reason = reason;
}
toString() {
return `Interrupted: ${super.toString()}`
return `Network: ${super.toString()}`
}
}
@@ -1520,18 +1531,15 @@ export class Backoff extends SuggestApiError {
}
}
export class Network extends SuggestApiError {
export class Interrupted extends SuggestApiError {
constructor(
reason,
...params
) {
const message = `reason: ${ reason }`;
super(message, ...params);
this.reason = reason;
super(...params);
}
toString() {
return `Network: ${super.toString()}`
return `Interrupted: ${super.toString()}`
}
}
@@ -1555,15 +1563,15 @@ export class FfiConverterTypeSuggestApiError extends FfiConverterArrayBuffer {
static read(dataStream) {
switch (dataStream.readInt32()) {
case 1:
return new Interrupted(
return new Network(
FfiConverterString.read(dataStream)
);
case 2:
return new Backoff(
FfiConverterU64.read(dataStream)
);
case 3:
return new Network(
FfiConverterString.read(dataStream)
return new Interrupted(
);
case 4:
return new Other(
@@ -1576,15 +1584,15 @@ export class FfiConverterTypeSuggestApiError extends FfiConverterArrayBuffer {
static computeSize(value) {
// Size of the Int indicating the variant
let totalSize = 4;
if (value instanceof Interrupted) {
if (value instanceof Network) {
totalSize += FfiConverterString.computeSize(value.reason);
return totalSize;
}
if (value instanceof Backoff) {
totalSize += FfiConverterU64.computeSize(value.seconds);
return totalSize;
}
if (value instanceof Network) {
totalSize += FfiConverterString.computeSize(value.reason);
if (value instanceof Interrupted) {
return totalSize;
}
if (value instanceof Other) {
@@ -1594,8 +1602,9 @@ export class FfiConverterTypeSuggestApiError extends FfiConverterArrayBuffer {
throw new UniFFITypeError("Unknown SuggestApiError variant");
}
static write(dataStream, value) {
if (value instanceof Interrupted) {
if (value instanceof Network) {
dataStream.writeInt32(1);
FfiConverterString.write(dataStream, value.reason);
return;
}
if (value instanceof Backoff) {
@@ -1603,9 +1612,8 @@ export class FfiConverterTypeSuggestApiError extends FfiConverterArrayBuffer {
FfiConverterU64.write(dataStream, value.seconds);
return;
}
if (value instanceof Network) {
if (value instanceof Interrupted) {
dataStream.writeInt32(3);
FfiConverterString.write(dataStream, value.reason);
return;
}
if (value instanceof Other) {
@@ -1844,7 +1852,7 @@ export class FfiConverterTypeSuggestion extends FfiConverterArrayBuffer {
FfiConverterString.read(dataStream),
FfiConverterString.read(dataStream),
FfiConverterString.read(dataStream),
FfiConverterOptionalSequenceu8.read(dataStream),
FfiConverterOptionalbytes.read(dataStream),
FfiConverterOptionalstring.read(dataStream),
FfiConverterString.read(dataStream),
FfiConverterI64.read(dataStream),
@@ -1866,7 +1874,7 @@ export class FfiConverterTypeSuggestion extends FfiConverterArrayBuffer {
return new Suggestion.Wikipedia(
FfiConverterString.read(dataStream),
FfiConverterString.read(dataStream),
FfiConverterOptionalSequenceu8.read(dataStream),
FfiConverterOptionalbytes.read(dataStream),
FfiConverterOptionalstring.read(dataStream),
FfiConverterString.read(dataStream)
);
@@ -1885,7 +1893,7 @@ export class FfiConverterTypeSuggestion extends FfiConverterArrayBuffer {
return new Suggestion.Yelp(
FfiConverterString.read(dataStream),
FfiConverterString.read(dataStream),
FfiConverterOptionalSequenceu8.read(dataStream),
FfiConverterOptionalbytes.read(dataStream),
FfiConverterOptionalstring.read(dataStream),
FfiConverterF64.read(dataStream),
FfiConverterBool.read(dataStream),
@@ -1911,7 +1919,7 @@ export class FfiConverterTypeSuggestion extends FfiConverterArrayBuffer {
FfiConverterString.read(dataStream),
FfiConverterI64.read(dataStream),
FfiConverterString.read(dataStream),
FfiConverterOptionalSequenceu8.read(dataStream),
FfiConverterOptionalbytes.read(dataStream),
FfiConverterOptionalstring.read(dataStream),
FfiConverterF64.read(dataStream)
);
@@ -1931,7 +1939,7 @@ export class FfiConverterTypeSuggestion extends FfiConverterArrayBuffer {
FfiConverterString.write(dataStream, value.title);
FfiConverterString.write(dataStream, value.url);
FfiConverterString.write(dataStream, value.rawUrl);
FfiConverterOptionalSequenceu8.write(dataStream, value.icon);
FfiConverterOptionalbytes.write(dataStream, value.icon);
FfiConverterOptionalstring.write(dataStream, value.iconMimetype);
FfiConverterString.write(dataStream, value.fullKeyword);
FfiConverterI64.write(dataStream, value.blockId);
@@ -1955,7 +1963,7 @@ export class FfiConverterTypeSuggestion extends FfiConverterArrayBuffer {
dataStream.writeInt32(3);
FfiConverterString.write(dataStream, value.title);
FfiConverterString.write(dataStream, value.url);
FfiConverterOptionalSequenceu8.write(dataStream, value.icon);
FfiConverterOptionalbytes.write(dataStream, value.icon);
FfiConverterOptionalstring.write(dataStream, value.iconMimetype);
FfiConverterString.write(dataStream, value.fullKeyword);
return;
@@ -1976,7 +1984,7 @@ export class FfiConverterTypeSuggestion extends FfiConverterArrayBuffer {
dataStream.writeInt32(5);
FfiConverterString.write(dataStream, value.url);
FfiConverterString.write(dataStream, value.title);
FfiConverterOptionalSequenceu8.write(dataStream, value.icon);
FfiConverterOptionalbytes.write(dataStream, value.icon);
FfiConverterOptionalstring.write(dataStream, value.iconMimetype);
FfiConverterF64.write(dataStream, value.score);
FfiConverterBool.write(dataStream, value.hasLocationSign);
@@ -2005,7 +2013,7 @@ export class FfiConverterTypeSuggestion extends FfiConverterArrayBuffer {
FfiConverterString.write(dataStream, value.title);
FfiConverterI64.write(dataStream, value.totalReviews);
FfiConverterString.write(dataStream, value.url);
FfiConverterOptionalSequenceu8.write(dataStream, value.icon);
FfiConverterOptionalbytes.write(dataStream, value.icon);
FfiConverterOptionalstring.write(dataStream, value.iconMimetype);
FfiConverterF64.write(dataStream, value.score);
return;
@@ -2026,7 +2034,7 @@ export class FfiConverterTypeSuggestion extends FfiConverterArrayBuffer {
totalSize += FfiConverterString.computeSize(value.title);
totalSize += FfiConverterString.computeSize(value.url);
totalSize += FfiConverterString.computeSize(value.rawUrl);
totalSize += FfiConverterOptionalSequenceu8.computeSize(value.icon);
totalSize += FfiConverterOptionalbytes.computeSize(value.icon);
totalSize += FfiConverterOptionalstring.computeSize(value.iconMimetype);
totalSize += FfiConverterString.computeSize(value.fullKeyword);
totalSize += FfiConverterI64.computeSize(value.blockId);
@@ -2048,7 +2056,7 @@ export class FfiConverterTypeSuggestion extends FfiConverterArrayBuffer {
if (value instanceof Suggestion.Wikipedia) {
totalSize += FfiConverterString.computeSize(value.title);
totalSize += FfiConverterString.computeSize(value.url);
totalSize += FfiConverterOptionalSequenceu8.computeSize(value.icon);
totalSize += FfiConverterOptionalbytes.computeSize(value.icon);
totalSize += FfiConverterOptionalstring.computeSize(value.iconMimetype);
totalSize += FfiConverterString.computeSize(value.fullKeyword);
return totalSize;
@@ -2067,7 +2075,7 @@ export class FfiConverterTypeSuggestion extends FfiConverterArrayBuffer {
if (value instanceof Suggestion.Yelp) {
totalSize += FfiConverterString.computeSize(value.url);
totalSize += FfiConverterString.computeSize(value.title);
totalSize += FfiConverterOptionalSequenceu8.computeSize(value.icon);
totalSize += FfiConverterOptionalbytes.computeSize(value.icon);
totalSize += FfiConverterOptionalstring.computeSize(value.iconMimetype);
totalSize += FfiConverterF64.computeSize(value.score);
totalSize += FfiConverterBool.computeSize(value.hasLocationSign);
@@ -2093,7 +2101,7 @@ export class FfiConverterTypeSuggestion extends FfiConverterArrayBuffer {
totalSize += FfiConverterString.computeSize(value.title);
totalSize += FfiConverterI64.computeSize(value.totalReviews);
totalSize += FfiConverterString.computeSize(value.url);
totalSize += FfiConverterOptionalSequenceu8.computeSize(value.icon);
totalSize += FfiConverterOptionalbytes.computeSize(value.icon);
totalSize += FfiConverterOptionalstring.computeSize(value.iconMimetype);
totalSize += FfiConverterF64.computeSize(value.score);
return totalSize;
@@ -2117,9 +2125,9 @@ export class FfiConverterTypeSuggestion extends FfiConverterArrayBuffer {
export const SuggestionProvider = {
AMP: 1,
POCKET: 2,
WIKIPEDIA: 3,
AMO: 4,
WIKIPEDIA: 2,
AMO: 3,
POCKET: 4,
YELP: 5,
MDN: 6,
WEATHER: 7,
@@ -2136,11 +2144,11 @@ export class FfiConverterTypeSuggestionProvider extends FfiConverterArrayBuffer
case 1:
return SuggestionProvider.AMP
case 2:
return SuggestionProvider.POCKET
case 3:
return SuggestionProvider.WIKIPEDIA
case 4:
case 3:
return SuggestionProvider.AMO
case 4:
return SuggestionProvider.POCKET
case 5:
return SuggestionProvider.YELP
case 6:
@@ -2163,15 +2171,15 @@ export class FfiConverterTypeSuggestionProvider extends FfiConverterArrayBuffer
dataStream.writeInt32(1);
return;
}
if (value === SuggestionProvider.POCKET) {
if (value === SuggestionProvider.WIKIPEDIA) {
dataStream.writeInt32(2);
return;
}
if (value === SuggestionProvider.WIKIPEDIA) {
if (value === SuggestionProvider.AMO) {
dataStream.writeInt32(3);
return;
}
if (value === SuggestionProvider.AMO) {
if (value === SuggestionProvider.POCKET) {
dataStream.writeInt32(4);
return;
}
@@ -2288,6 +2296,43 @@ export class FfiConverterOptionalstring extends FfiConverterArrayBuffer {
}
}
// Export the FFIConverter object to make external types work.
export class FfiConverterOptionalbytes extends FfiConverterArrayBuffer {
static checkType(value) {
if (value !== undefined && value !== null) {
FfiConverterBytes.checkType(value)
}
}
static read(dataStream) {
const code = dataStream.readUint8(0);
switch (code) {
case 0:
return null
case 1:
return FfiConverterBytes.read(dataStream)
default:
throw UniFFIError(`Unexpected code: ${code}`);
}
}
static write(dataStream, value) {
if (value === null || value === undefined) {
dataStream.writeUint8(0);
return;
}
dataStream.writeUint8(1);
FfiConverterBytes.write(dataStream, value)
}
static computeSize(value) {
if (value === null || value === undefined) {
return 1;
}
return 1 + FfiConverterBytes.computeSize(value)
}
}
// Export the FFIConverter object to make external types work.
export class FfiConverterOptionalTypeSuggestionProviderConstraints extends FfiConverterArrayBuffer {
static checkType(value) {
@@ -2399,43 +2444,6 @@ export class FfiConverterOptionalTypeSuggestProviderConfig extends FfiConverterA
}
}
// Export the FFIConverter object to make external types work.
export class FfiConverterOptionalSequenceu8 extends FfiConverterArrayBuffer {
static checkType(value) {
if (value !== undefined && value !== null) {
FfiConverterSequenceu8.checkType(value)
}
}
static read(dataStream) {
const code = dataStream.readUint8(0);
switch (code) {
case 0:
return null
case 1:
return FfiConverterSequenceu8.read(dataStream)
default:
throw UniFFIError(`Unexpected code: ${code}`);
}
}
static write(dataStream, value) {
if (value === null || value === undefined) {
dataStream.writeUint8(0);
return;
}
dataStream.writeUint8(1);
FfiConverterSequenceu8.write(dataStream, value)
}
static computeSize(value) {
if (value === null || value === undefined) {
return 1;
}
return 1 + FfiConverterSequenceu8.computeSize(value)
}
}
// Export the FFIConverter object to make external types work.
export class FfiConverterOptionalSequencestring extends FfiConverterArrayBuffer {
static checkType(value) {
@@ -2547,50 +2555,6 @@ export class FfiConverterOptionalTypeRemoteSettingsConfig extends FfiConverterAr
}
}
// Export the FFIConverter object to make external types work.
export class FfiConverterSequenceu8 extends FfiConverterArrayBuffer {
static read(dataStream) {
const len = dataStream.readInt32();
const arr = [];
for (let i = 0; i < len; i++) {
arr.push(FfiConverterU8.read(dataStream));
}
return arr;
}
static write(dataStream, value) {
dataStream.writeInt32(value.length);
value.forEach((innerValue) => {
FfiConverterU8.write(dataStream, innerValue);
})
}
static computeSize(value) {
// The size of the length
let size = 4;
for (const innerValue of value) {
size += FfiConverterU8.computeSize(innerValue);
}
return size;
}
static checkType(value) {
if (!Array.isArray(value)) {
throw new UniFFITypeError(`${value} is not an array`);
}
value.forEach((innerValue, idx) => {
try {
FfiConverterU8.checkType(innerValue);
} catch (e) {
if (e instanceof UniFFITypeError) {
e.addItemDescriptionPart(`[${idx}]`);
}
throw e;
}
})
}
}
// Export the FFIConverter object to make external types work.
export class FfiConverterSequencestring extends FfiConverterArrayBuffer {
static read(dataStream) {
@@ -2787,7 +2751,7 @@ export { FfiConverterTypeRemoteSettingsServer, RemoteSettingsServer };
export function rawSuggestionUrlMatches(rawUrl,url) {
export function rawSuggestionUrlMatches(rawUrl,cookedUrl) {
const liftResult = (result) => FfiConverterBool.lift(result);
const liftError = null;
@@ -2801,17 +2765,17 @@ export function rawSuggestionUrlMatches(rawUrl,url) {
throw e;
}
try {
FfiConverterString.checkType(url)
FfiConverterString.checkType(cookedUrl)
} catch (e) {
if (e instanceof UniFFITypeError) {
e.addItemDescriptionPart("url");
e.addItemDescriptionPart("cookedUrl");
}
throw e;
}
return UniFFIScaffolding.callSync(
10, // suggest:uniffi_suggest_fn_func_raw_suggestion_url_matches
11, // suggest:uniffi_suggest_fn_func_raw_suggestion_url_matches
FfiConverterString.lower(rawUrl),
FfiConverterString.lower(url),
FfiConverterString.lower(cookedUrl),
)
}
return handleRustResult(functionCall(), liftResult, liftError);

View File

@@ -153,6 +153,20 @@ class ArrayBufferDataStream {
this.pos += size;
return value;
}
readBytes() {
const size = this.readInt32();
const bytes = new Uint8Array(this.dataView.buffer, this.pos, size);
this.pos += size;
return bytes
}
writeBytes(uint8Array) {
this.writeUint32(uint8Array.length);
value.forEach((elt) => {
dataStream.writeUint8(elt);
})
}
}
function handleRustResult(result, liftCallback, liftErrCallback) {

View File

@@ -154,6 +154,20 @@ class ArrayBufferDataStream {
return value;
}
readBytes() {
const size = this.readInt32();
const bytes = new Uint8Array(this.dataView.buffer, this.pos, size);
this.pos += size;
return bytes
}
writeBytes(uint8Array) {
this.writeUint32(uint8Array.length);
value.forEach((elt) => {
dataStream.writeUint8(elt);
})
}
// Reads a RemoteCommandStore pointer from the data stream
// UniFFI Pointers are **always** 8 bytes long. That is enforced
// by the C++ and Rust Scaffolding code.
@@ -396,7 +410,7 @@ export class RemoteCommandStore {
throw e;
}
return UniFFIScaffolding.callAsync(
28, // tabs:uniffi_tabs_fn_method_remotecommandstore_add_remote_command
29, // tabs:uniffi_tabs_fn_method_remotecommandstore_add_remote_command
FfiConverterTypeRemoteCommandStore.lower(this),
FfiConverterString.lower(deviceId),
FfiConverterTypeRemoteCommand.lower(command),
@@ -438,7 +452,7 @@ export class RemoteCommandStore {
throw e;
}
return UniFFIScaffolding.callAsync(
29, // tabs:uniffi_tabs_fn_method_remotecommandstore_add_remote_command_at
30, // tabs:uniffi_tabs_fn_method_remotecommandstore_add_remote_command_at
FfiConverterTypeRemoteCommandStore.lower(this),
FfiConverterString.lower(deviceId),
FfiConverterTypeRemoteCommand.lower(command),
@@ -457,7 +471,7 @@ export class RemoteCommandStore {
const liftError = (data) => FfiConverterTypeTabsApiError.lift(data);
const functionCall = () => {
return UniFFIScaffolding.callAsync(
30, // tabs:uniffi_tabs_fn_method_remotecommandstore_get_unsent_commands
31, // tabs:uniffi_tabs_fn_method_remotecommandstore_get_unsent_commands
FfiConverterTypeRemoteCommandStore.lower(this),
)
}
@@ -489,7 +503,7 @@ export class RemoteCommandStore {
throw e;
}
return UniFFIScaffolding.callAsync(
31, // tabs:uniffi_tabs_fn_method_remotecommandstore_remove_remote_command
32, // tabs:uniffi_tabs_fn_method_remotecommandstore_remove_remote_command
FfiConverterTypeRemoteCommandStore.lower(this),
FfiConverterString.lower(deviceId),
FfiConverterTypeRemoteCommand.lower(command),
@@ -515,7 +529,7 @@ export class RemoteCommandStore {
throw e;
}
return UniFFIScaffolding.callAsync(
32, // tabs:uniffi_tabs_fn_method_remotecommandstore_set_pending_command_sent
33, // tabs:uniffi_tabs_fn_method_remotecommandstore_set_pending_command_sent
FfiConverterTypeRemoteCommandStore.lower(this),
FfiConverterTypePendingCommand.lower(command),
)
@@ -577,7 +591,7 @@ export class TabsBridgedEngine {
const liftError = (data) => FfiConverterTypeTabsApiError.lift(data);
const functionCall = () => {
return UniFFIScaffolding.callAsync(
33, // tabs:uniffi_tabs_fn_method_tabsbridgedengine_apply
34, // tabs:uniffi_tabs_fn_method_tabsbridgedengine_apply
FfiConverterTypeTabsBridgedEngine.lower(this),
)
}
@@ -601,7 +615,7 @@ export class TabsBridgedEngine {
throw e;
}
return UniFFIScaffolding.callAsync(
34, // tabs:uniffi_tabs_fn_method_tabsbridgedengine_ensure_current_sync_id
35, // tabs:uniffi_tabs_fn_method_tabsbridgedengine_ensure_current_sync_id
FfiConverterTypeTabsBridgedEngine.lower(this),
FfiConverterString.lower(newSyncId),
)
@@ -618,7 +632,7 @@ export class TabsBridgedEngine {
const liftError = (data) => FfiConverterTypeTabsApiError.lift(data);
const functionCall = () => {
return UniFFIScaffolding.callAsync(
35, // tabs:uniffi_tabs_fn_method_tabsbridgedengine_last_sync
36, // tabs:uniffi_tabs_fn_method_tabsbridgedengine_last_sync
FfiConverterTypeTabsBridgedEngine.lower(this),
)
}
@@ -642,7 +656,7 @@ export class TabsBridgedEngine {
throw e;
}
return UniFFIScaffolding.callAsync(
36, // tabs:uniffi_tabs_fn_method_tabsbridgedengine_prepare_for_sync
37, // tabs:uniffi_tabs_fn_method_tabsbridgedengine_prepare_for_sync
FfiConverterTypeTabsBridgedEngine.lower(this),
FfiConverterString.lower(clientData),
)
@@ -659,7 +673,7 @@ export class TabsBridgedEngine {
const liftError = (data) => FfiConverterTypeTabsApiError.lift(data);
const functionCall = () => {
return UniFFIScaffolding.callAsync(
37, // tabs:uniffi_tabs_fn_method_tabsbridgedengine_reset
38, // tabs:uniffi_tabs_fn_method_tabsbridgedengine_reset
FfiConverterTypeTabsBridgedEngine.lower(this),
)
}
@@ -675,7 +689,7 @@ export class TabsBridgedEngine {
const liftError = (data) => FfiConverterTypeTabsApiError.lift(data);
const functionCall = () => {
return UniFFIScaffolding.callAsync(
38, // tabs:uniffi_tabs_fn_method_tabsbridgedengine_reset_sync_id
39, // tabs:uniffi_tabs_fn_method_tabsbridgedengine_reset_sync_id
FfiConverterTypeTabsBridgedEngine.lower(this),
)
}
@@ -699,7 +713,7 @@ export class TabsBridgedEngine {
throw e;
}
return UniFFIScaffolding.callAsync(
39, // tabs:uniffi_tabs_fn_method_tabsbridgedengine_set_last_sync
40, // tabs:uniffi_tabs_fn_method_tabsbridgedengine_set_last_sync
FfiConverterTypeTabsBridgedEngine.lower(this),
FfiConverterI64.lower(lastSync),
)
@@ -732,7 +746,7 @@ export class TabsBridgedEngine {
throw e;
}
return UniFFIScaffolding.callAsync(
40, // tabs:uniffi_tabs_fn_method_tabsbridgedengine_set_uploaded
41, // tabs:uniffi_tabs_fn_method_tabsbridgedengine_set_uploaded
FfiConverterTypeTabsBridgedEngine.lower(this),
FfiConverterI64.lower(newTimestamp),
FfiConverterSequenceTypeTabsGuid.lower(uploadedIds),
@@ -758,7 +772,7 @@ export class TabsBridgedEngine {
throw e;
}
return UniFFIScaffolding.callAsync(
41, // tabs:uniffi_tabs_fn_method_tabsbridgedengine_store_incoming
42, // tabs:uniffi_tabs_fn_method_tabsbridgedengine_store_incoming
FfiConverterTypeTabsBridgedEngine.lower(this),
FfiConverterSequencestring.lower(incomingEnvelopesAsJson),
)
@@ -775,7 +789,7 @@ export class TabsBridgedEngine {
const liftError = (data) => FfiConverterTypeTabsApiError.lift(data);
const functionCall = () => {
return UniFFIScaffolding.callAsync(
42, // tabs:uniffi_tabs_fn_method_tabsbridgedengine_sync_finished
43, // tabs:uniffi_tabs_fn_method_tabsbridgedengine_sync_finished
FfiConverterTypeTabsBridgedEngine.lower(this),
)
}
@@ -791,7 +805,7 @@ export class TabsBridgedEngine {
const liftError = (data) => FfiConverterTypeTabsApiError.lift(data);
const functionCall = () => {
return UniFFIScaffolding.callAsync(
43, // tabs:uniffi_tabs_fn_method_tabsbridgedengine_sync_id
44, // tabs:uniffi_tabs_fn_method_tabsbridgedengine_sync_id
FfiConverterTypeTabsBridgedEngine.lower(this),
)
}
@@ -807,7 +821,7 @@ export class TabsBridgedEngine {
const liftError = (data) => FfiConverterTypeTabsApiError.lift(data);
const functionCall = () => {
return UniFFIScaffolding.callAsync(
44, // tabs:uniffi_tabs_fn_method_tabsbridgedengine_sync_started
45, // tabs:uniffi_tabs_fn_method_tabsbridgedengine_sync_started
FfiConverterTypeTabsBridgedEngine.lower(this),
)
}
@@ -823,7 +837,7 @@ export class TabsBridgedEngine {
const liftError = (data) => FfiConverterTypeTabsApiError.lift(data);
const functionCall = () => {
return UniFFIScaffolding.callAsync(
45, // tabs:uniffi_tabs_fn_method_tabsbridgedengine_wipe
46, // tabs:uniffi_tabs_fn_method_tabsbridgedengine_wipe
FfiConverterTypeTabsBridgedEngine.lower(this),
)
}
@@ -897,7 +911,7 @@ export class TabsStore {
throw e;
}
return UniFFIScaffolding.callAsync(
52, // tabs:uniffi_tabs_fn_constructor_tabsstore_new
53, // tabs:uniffi_tabs_fn_constructor_tabsstore_new
FfiConverterString.lower(path),
)
}
@@ -912,7 +926,7 @@ export class TabsStore {
const liftError = null;
const functionCall = () => {
return UniFFIScaffolding.callAsync(
46, // tabs:uniffi_tabs_fn_method_tabsstore_bridged_engine
47, // tabs:uniffi_tabs_fn_method_tabsstore_bridged_engine
FfiConverterTypeTabsStore.lower(this),
)
}
@@ -928,7 +942,7 @@ export class TabsStore {
const liftError = null;
const functionCall = () => {
return UniFFIScaffolding.callAsync(
47, // tabs:uniffi_tabs_fn_method_tabsstore_close_connection
48, // tabs:uniffi_tabs_fn_method_tabsstore_close_connection
FfiConverterTypeTabsStore.lower(this),
)
}
@@ -944,7 +958,7 @@ export class TabsStore {
const liftError = null;
const functionCall = () => {
return UniFFIScaffolding.callAsync(
48, // tabs:uniffi_tabs_fn_method_tabsstore_get_all
49, // tabs:uniffi_tabs_fn_method_tabsstore_get_all
FfiConverterTypeTabsStore.lower(this),
)
}
@@ -960,7 +974,7 @@ export class TabsStore {
const liftError = null;
const functionCall = () => {
return UniFFIScaffolding.callAsync(
49, // tabs:uniffi_tabs_fn_method_tabsstore_new_remote_command_store
50, // tabs:uniffi_tabs_fn_method_tabsstore_new_remote_command_store
FfiConverterTypeTabsStore.lower(this),
)
}
@@ -976,7 +990,7 @@ export class TabsStore {
const liftError = null;
const functionCall = () => {
return UniFFIScaffolding.callAsync(
50, // tabs:uniffi_tabs_fn_method_tabsstore_register_with_sync_manager
51, // tabs:uniffi_tabs_fn_method_tabsstore_register_with_sync_manager
FfiConverterTypeTabsStore.lower(this),
)
}
@@ -1000,7 +1014,7 @@ export class TabsStore {
throw e;
}
return UniFFIScaffolding.callAsync(
51, // tabs:uniffi_tabs_fn_method_tabsstore_set_local_tabs
52, // tabs:uniffi_tabs_fn_method_tabsstore_set_local_tabs
FfiConverterTypeTabsStore.lower(this),
FfiConverterSequenceTypeRemoteTabRecord.lower(remoteTabs),
)

View File

@@ -153,6 +153,20 @@ class ArrayBufferDataStream {
this.pos += size;
return value;
}
readBytes() {
const size = this.readInt32();
const bytes = new Uint8Array(this.dataView.buffer, this.pos, size);
this.pos += size;
return bytes
}
writeBytes(uint8Array) {
this.writeUint32(uint8Array.length);
value.forEach((elt) => {
dataStream.writeUint8(elt);
})
}
}
function handleRustResult(result, liftCallback, liftErrCallback) {
@@ -376,7 +390,7 @@ export function add(a,b) {
throw e;
}
return UniFFIScaffolding.callAsync(
53, // arithmetic:uniffi_arithmetical_fn_func_add
54, // arithmetic:uniffi_arithmetical_fn_func_add
FfiConverterU64.lower(a),
FfiConverterU64.lower(b),
)
@@ -410,7 +424,7 @@ export function div(dividend,divisor) {
throw e;
}
return UniFFIScaffolding.callAsync(
54, // arithmetic:uniffi_arithmetical_fn_func_div
55, // arithmetic:uniffi_arithmetical_fn_func_div
FfiConverterU64.lower(dividend),
FfiConverterU64.lower(divisor),
)
@@ -444,7 +458,7 @@ export function equal(a,b) {
throw e;
}
return UniFFIScaffolding.callAsync(
55, // arithmetic:uniffi_arithmetical_fn_func_equal
56, // arithmetic:uniffi_arithmetical_fn_func_equal
FfiConverterU64.lower(a),
FfiConverterU64.lower(b),
)
@@ -478,7 +492,7 @@ export function sub(a,b) {
throw e;
}
return UniFFIScaffolding.callAsync(
56, // arithmetic:uniffi_arithmetical_fn_func_sub
57, // arithmetic:uniffi_arithmetical_fn_func_sub
FfiConverterU64.lower(a),
FfiConverterU64.lower(b),
)

View File

@@ -153,6 +153,20 @@ class ArrayBufferDataStream {
this.pos += size;
return value;
}
readBytes() {
const size = this.readInt32();
const bytes = new Uint8Array(this.dataView.buffer, this.pos, size);
this.pos += size;
return bytes
}
writeBytes(uint8Array) {
this.writeUint32(uint8Array.length);
value.forEach((elt) => {
dataStream.writeUint8(elt);
})
}
}
function handleRustResult(result, liftCallback, liftErrCallback) {
@@ -454,7 +468,7 @@ export function getCustomTypesDemo(demo) {
throw e;
}
return UniFFIScaffolding.callAsync(
57, // custom_types:uniffi_uniffi_custom_types_fn_func_get_custom_types_demo
58, // custom_types:uniffi_uniffi_custom_types_fn_func_get_custom_types_demo
FfiConverterOptionalTypeCustomTypesDemo.lower(demo),
)
}

View File

@@ -153,6 +153,20 @@ class ArrayBufferDataStream {
this.pos += size;
return value;
}
readBytes() {
const size = this.readInt32();
const bytes = new Uint8Array(this.dataView.buffer, this.pos, size);
this.pos += size;
return bytes
}
writeBytes(uint8Array) {
this.writeUint32(uint8Array.length);
value.forEach((elt) => {
dataStream.writeUint8(elt);
})
}
}
function handleRustResult(result, liftCallback, liftErrCallback) {
@@ -380,7 +394,7 @@ export function gradient(value) {
throw e;
}
return UniFFIScaffolding.callAsync(
58, // external_types:uniffi_uniffi_fixture_external_types_fn_func_gradient
59, // external_types:uniffi_uniffi_fixture_external_types_fn_func_gradient
FfiConverterOptionalTypeLine.lower(value),
)
}
@@ -413,7 +427,7 @@ export function intersection(ln1,ln2) {
throw e;
}
return UniFFIScaffolding.callAsync(
59, // external_types:uniffi_uniffi_fixture_external_types_fn_func_intersection
60, // external_types:uniffi_uniffi_fixture_external_types_fn_func_intersection
FfiConverterTypeLine.lower(ln1),
FfiConverterTypeLine.lower(ln2),
)

View File

@@ -153,6 +153,20 @@ class ArrayBufferDataStream {
this.pos += size;
return value;
}
readBytes() {
const size = this.readInt32();
const bytes = new Uint8Array(this.dataView.buffer, this.pos, size);
this.pos += size;
return bytes
}
writeBytes(uint8Array) {
this.writeUint32(uint8Array.length);
value.forEach((elt) => {
dataStream.writeUint8(elt);
})
}
}
function handleRustResult(result, liftCallback, liftErrCallback) {
@@ -473,7 +487,7 @@ export function gradient(ln) {
throw e;
}
return UniFFIScaffolding.callAsync(
60, // geometry:uniffi_uniffi_geometry_fn_func_gradient
61, // geometry:uniffi_uniffi_geometry_fn_func_gradient
FfiConverterTypeLine.lower(ln),
)
}
@@ -506,7 +520,7 @@ export function intersection(ln1,ln2) {
throw e;
}
return UniFFIScaffolding.callAsync(
61, // geometry:uniffi_uniffi_geometry_fn_func_intersection
62, // geometry:uniffi_uniffi_geometry_fn_func_intersection
FfiConverterTypeLine.lower(ln1),
FfiConverterTypeLine.lower(ln2),
)

View File

@@ -154,6 +154,20 @@ class ArrayBufferDataStream {
return value;
}
readBytes() {
const size = this.readInt32();
const bytes = new Uint8Array(this.dataView.buffer, this.pos, size);
this.pos += size;
return bytes
}
writeBytes(uint8Array) {
this.writeUint32(uint8Array.length);
value.forEach((elt) => {
dataStream.writeUint8(elt);
})
}
// Reads a SingletonObject pointer from the data stream
// UniFFI Pointers are **always** 8 bytes long. That is enforced
// by the C++ and Rust Scaffolding code.
@@ -320,7 +334,7 @@ export class SingletonObject {
const liftError = null;
const functionCall = () => {
return UniFFIScaffolding.callSync(
64, // refcounts:uniffi_uniffi_fixture_refcounts_fn_method_singletonobject_method
65, // refcounts:uniffi_uniffi_fixture_refcounts_fn_method_singletonobject_method
FfiConverterTypeSingletonObject.lower(this),
)
}
@@ -368,7 +382,7 @@ export function getJsRefcount() {
const liftError = null;
const functionCall = () => {
return UniFFIScaffolding.callSync(
62, // refcounts:uniffi_uniffi_fixture_refcounts_fn_func_get_js_refcount
63, // refcounts:uniffi_uniffi_fixture_refcounts_fn_func_get_js_refcount
)
}
return handleRustResult(functionCall(), liftResult, liftError);
@@ -380,7 +394,7 @@ export function getSingleton() {
const liftError = null;
const functionCall = () => {
return UniFFIScaffolding.callSync(
63, // refcounts:uniffi_uniffi_fixture_refcounts_fn_func_get_singleton
64, // refcounts:uniffi_uniffi_fixture_refcounts_fn_func_get_singleton
)
}
return handleRustResult(functionCall(), liftResult, liftError);

View File

@@ -154,6 +154,20 @@ class ArrayBufferDataStream {
return value;
}
readBytes() {
const size = this.readInt32();
const bytes = new Uint8Array(this.dataView.buffer, this.pos, size);
this.pos += size;
return bytes
}
writeBytes(uint8Array) {
this.writeUint32(uint8Array.length);
value.forEach((elt) => {
dataStream.writeUint8(elt);
})
}
// Reads a Optionneur pointer from the data stream
// UniFFI Pointers are **always** 8 bytes long. That is enforced
// by the C++ and Rust Scaffolding code.
@@ -619,7 +633,7 @@ export class Optionneur {
const liftError = null;
const functionCall = () => {
return UniFFIScaffolding.callAsync(
95, // rondpoint:uniffi_uniffi_rondpoint_fn_constructor_optionneur_new
96, // rondpoint:uniffi_uniffi_rondpoint_fn_constructor_optionneur_new
)
}
try {
@@ -641,7 +655,7 @@ export class Optionneur {
throw e;
}
return UniFFIScaffolding.callAsync(
70, // rondpoint:uniffi_uniffi_rondpoint_fn_method_optionneur_sinon_boolean
71, // rondpoint:uniffi_uniffi_rondpoint_fn_method_optionneur_sinon_boolean
FfiConverterTypeOptionneur.lower(this),
FfiConverterBool.lower(value),
)
@@ -666,7 +680,7 @@ export class Optionneur {
throw e;
}
return UniFFIScaffolding.callAsync(
71, // rondpoint:uniffi_uniffi_rondpoint_fn_method_optionneur_sinon_enum
72, // rondpoint:uniffi_uniffi_rondpoint_fn_method_optionneur_sinon_enum
FfiConverterTypeOptionneur.lower(this),
FfiConverterTypeEnumeration.lower(value),
)
@@ -691,7 +705,7 @@ export class Optionneur {
throw e;
}
return UniFFIScaffolding.callAsync(
72, // rondpoint:uniffi_uniffi_rondpoint_fn_method_optionneur_sinon_f32
73, // rondpoint:uniffi_uniffi_rondpoint_fn_method_optionneur_sinon_f32
FfiConverterTypeOptionneur.lower(this),
FfiConverterF32.lower(value),
)
@@ -716,7 +730,7 @@ export class Optionneur {
throw e;
}
return UniFFIScaffolding.callAsync(
73, // rondpoint:uniffi_uniffi_rondpoint_fn_method_optionneur_sinon_f64
74, // rondpoint:uniffi_uniffi_rondpoint_fn_method_optionneur_sinon_f64
FfiConverterTypeOptionneur.lower(this),
FfiConverterF64.lower(value),
)
@@ -741,7 +755,7 @@ export class Optionneur {
throw e;
}
return UniFFIScaffolding.callAsync(
74, // rondpoint:uniffi_uniffi_rondpoint_fn_method_optionneur_sinon_i16_dec
75, // rondpoint:uniffi_uniffi_rondpoint_fn_method_optionneur_sinon_i16_dec
FfiConverterTypeOptionneur.lower(this),
FfiConverterI16.lower(value),
)
@@ -766,7 +780,7 @@ export class Optionneur {
throw e;
}
return UniFFIScaffolding.callAsync(
75, // rondpoint:uniffi_uniffi_rondpoint_fn_method_optionneur_sinon_i16_hex
76, // rondpoint:uniffi_uniffi_rondpoint_fn_method_optionneur_sinon_i16_hex
FfiConverterTypeOptionneur.lower(this),
FfiConverterI16.lower(value),
)
@@ -791,7 +805,7 @@ export class Optionneur {
throw e;
}
return UniFFIScaffolding.callAsync(
76, // rondpoint:uniffi_uniffi_rondpoint_fn_method_optionneur_sinon_i32_dec
77, // rondpoint:uniffi_uniffi_rondpoint_fn_method_optionneur_sinon_i32_dec
FfiConverterTypeOptionneur.lower(this),
FfiConverterI32.lower(value),
)
@@ -816,7 +830,7 @@ export class Optionneur {
throw e;
}
return UniFFIScaffolding.callAsync(
77, // rondpoint:uniffi_uniffi_rondpoint_fn_method_optionneur_sinon_i32_hex
78, // rondpoint:uniffi_uniffi_rondpoint_fn_method_optionneur_sinon_i32_hex
FfiConverterTypeOptionneur.lower(this),
FfiConverterI32.lower(value),
)
@@ -841,7 +855,7 @@ export class Optionneur {
throw e;
}
return UniFFIScaffolding.callAsync(
78, // rondpoint:uniffi_uniffi_rondpoint_fn_method_optionneur_sinon_i64_dec
79, // rondpoint:uniffi_uniffi_rondpoint_fn_method_optionneur_sinon_i64_dec
FfiConverterTypeOptionneur.lower(this),
FfiConverterI64.lower(value),
)
@@ -866,7 +880,7 @@ export class Optionneur {
throw e;
}
return UniFFIScaffolding.callAsync(
79, // rondpoint:uniffi_uniffi_rondpoint_fn_method_optionneur_sinon_i64_hex
80, // rondpoint:uniffi_uniffi_rondpoint_fn_method_optionneur_sinon_i64_hex
FfiConverterTypeOptionneur.lower(this),
FfiConverterI64.lower(value),
)
@@ -891,7 +905,7 @@ export class Optionneur {
throw e;
}
return UniFFIScaffolding.callAsync(
80, // rondpoint:uniffi_uniffi_rondpoint_fn_method_optionneur_sinon_i8_dec
81, // rondpoint:uniffi_uniffi_rondpoint_fn_method_optionneur_sinon_i8_dec
FfiConverterTypeOptionneur.lower(this),
FfiConverterI8.lower(value),
)
@@ -916,7 +930,7 @@ export class Optionneur {
throw e;
}
return UniFFIScaffolding.callAsync(
81, // rondpoint:uniffi_uniffi_rondpoint_fn_method_optionneur_sinon_i8_hex
82, // rondpoint:uniffi_uniffi_rondpoint_fn_method_optionneur_sinon_i8_hex
FfiConverterTypeOptionneur.lower(this),
FfiConverterI8.lower(value),
)
@@ -941,7 +955,7 @@ export class Optionneur {
throw e;
}
return UniFFIScaffolding.callAsync(
82, // rondpoint:uniffi_uniffi_rondpoint_fn_method_optionneur_sinon_null
83, // rondpoint:uniffi_uniffi_rondpoint_fn_method_optionneur_sinon_null
FfiConverterTypeOptionneur.lower(this),
FfiConverterOptionalstring.lower(value),
)
@@ -966,7 +980,7 @@ export class Optionneur {
throw e;
}
return UniFFIScaffolding.callAsync(
83, // rondpoint:uniffi_uniffi_rondpoint_fn_method_optionneur_sinon_sequence
84, // rondpoint:uniffi_uniffi_rondpoint_fn_method_optionneur_sinon_sequence
FfiConverterTypeOptionneur.lower(this),
FfiConverterSequencestring.lower(value),
)
@@ -991,7 +1005,7 @@ export class Optionneur {
throw e;
}
return UniFFIScaffolding.callAsync(
84, // rondpoint:uniffi_uniffi_rondpoint_fn_method_optionneur_sinon_string
85, // rondpoint:uniffi_uniffi_rondpoint_fn_method_optionneur_sinon_string
FfiConverterTypeOptionneur.lower(this),
FfiConverterString.lower(value),
)
@@ -1016,7 +1030,7 @@ export class Optionneur {
throw e;
}
return UniFFIScaffolding.callAsync(
85, // rondpoint:uniffi_uniffi_rondpoint_fn_method_optionneur_sinon_u16_dec
86, // rondpoint:uniffi_uniffi_rondpoint_fn_method_optionneur_sinon_u16_dec
FfiConverterTypeOptionneur.lower(this),
FfiConverterU16.lower(value),
)
@@ -1041,7 +1055,7 @@ export class Optionneur {
throw e;
}
return UniFFIScaffolding.callAsync(
86, // rondpoint:uniffi_uniffi_rondpoint_fn_method_optionneur_sinon_u16_hex
87, // rondpoint:uniffi_uniffi_rondpoint_fn_method_optionneur_sinon_u16_hex
FfiConverterTypeOptionneur.lower(this),
FfiConverterU16.lower(value),
)
@@ -1066,7 +1080,7 @@ export class Optionneur {
throw e;
}
return UniFFIScaffolding.callAsync(
87, // rondpoint:uniffi_uniffi_rondpoint_fn_method_optionneur_sinon_u32_dec
88, // rondpoint:uniffi_uniffi_rondpoint_fn_method_optionneur_sinon_u32_dec
FfiConverterTypeOptionneur.lower(this),
FfiConverterU32.lower(value),
)
@@ -1091,7 +1105,7 @@ export class Optionneur {
throw e;
}
return UniFFIScaffolding.callAsync(
88, // rondpoint:uniffi_uniffi_rondpoint_fn_method_optionneur_sinon_u32_hex
89, // rondpoint:uniffi_uniffi_rondpoint_fn_method_optionneur_sinon_u32_hex
FfiConverterTypeOptionneur.lower(this),
FfiConverterU32.lower(value),
)
@@ -1116,7 +1130,7 @@ export class Optionneur {
throw e;
}
return UniFFIScaffolding.callAsync(
89, // rondpoint:uniffi_uniffi_rondpoint_fn_method_optionneur_sinon_u32_oct
90, // rondpoint:uniffi_uniffi_rondpoint_fn_method_optionneur_sinon_u32_oct
FfiConverterTypeOptionneur.lower(this),
FfiConverterU32.lower(value),
)
@@ -1141,7 +1155,7 @@ export class Optionneur {
throw e;
}
return UniFFIScaffolding.callAsync(
90, // rondpoint:uniffi_uniffi_rondpoint_fn_method_optionneur_sinon_u64_dec
91, // rondpoint:uniffi_uniffi_rondpoint_fn_method_optionneur_sinon_u64_dec
FfiConverterTypeOptionneur.lower(this),
FfiConverterU64.lower(value),
)
@@ -1166,7 +1180,7 @@ export class Optionneur {
throw e;
}
return UniFFIScaffolding.callAsync(
91, // rondpoint:uniffi_uniffi_rondpoint_fn_method_optionneur_sinon_u64_hex
92, // rondpoint:uniffi_uniffi_rondpoint_fn_method_optionneur_sinon_u64_hex
FfiConverterTypeOptionneur.lower(this),
FfiConverterU64.lower(value),
)
@@ -1191,7 +1205,7 @@ export class Optionneur {
throw e;
}
return UniFFIScaffolding.callAsync(
92, // rondpoint:uniffi_uniffi_rondpoint_fn_method_optionneur_sinon_u8_dec
93, // rondpoint:uniffi_uniffi_rondpoint_fn_method_optionneur_sinon_u8_dec
FfiConverterTypeOptionneur.lower(this),
FfiConverterU8.lower(value),
)
@@ -1216,7 +1230,7 @@ export class Optionneur {
throw e;
}
return UniFFIScaffolding.callAsync(
93, // rondpoint:uniffi_uniffi_rondpoint_fn_method_optionneur_sinon_u8_hex
94, // rondpoint:uniffi_uniffi_rondpoint_fn_method_optionneur_sinon_u8_hex
FfiConverterTypeOptionneur.lower(this),
FfiConverterU8.lower(value),
)
@@ -1241,7 +1255,7 @@ export class Optionneur {
throw e;
}
return UniFFIScaffolding.callAsync(
94, // rondpoint:uniffi_uniffi_rondpoint_fn_method_optionneur_sinon_zero
95, // rondpoint:uniffi_uniffi_rondpoint_fn_method_optionneur_sinon_zero
FfiConverterTypeOptionneur.lower(this),
FfiConverterOptionali32.lower(value),
)
@@ -1308,7 +1322,7 @@ export class Retourneur {
const liftError = null;
const functionCall = () => {
return UniFFIScaffolding.callAsync(
111, // rondpoint:uniffi_uniffi_rondpoint_fn_constructor_retourneur_new
112, // rondpoint:uniffi_uniffi_rondpoint_fn_constructor_retourneur_new
)
}
try {
@@ -1330,7 +1344,7 @@ export class Retourneur {
throw e;
}
return UniFFIScaffolding.callAsync(
96, // rondpoint:uniffi_uniffi_rondpoint_fn_method_retourneur_identique_boolean
97, // rondpoint:uniffi_uniffi_rondpoint_fn_method_retourneur_identique_boolean
FfiConverterTypeRetourneur.lower(this),
FfiConverterBool.lower(value),
)
@@ -1355,7 +1369,7 @@ export class Retourneur {
throw e;
}
return UniFFIScaffolding.callAsync(
97, // rondpoint:uniffi_uniffi_rondpoint_fn_method_retourneur_identique_double
98, // rondpoint:uniffi_uniffi_rondpoint_fn_method_retourneur_identique_double
FfiConverterTypeRetourneur.lower(this),
FfiConverterF64.lower(value),
)
@@ -1380,7 +1394,7 @@ export class Retourneur {
throw e;
}
return UniFFIScaffolding.callAsync(
98, // rondpoint:uniffi_uniffi_rondpoint_fn_method_retourneur_identique_float
99, // rondpoint:uniffi_uniffi_rondpoint_fn_method_retourneur_identique_float
FfiConverterTypeRetourneur.lower(this),
FfiConverterF32.lower(value),
)
@@ -1405,7 +1419,7 @@ export class Retourneur {
throw e;
}
return UniFFIScaffolding.callAsync(
99, // rondpoint:uniffi_uniffi_rondpoint_fn_method_retourneur_identique_i16
100, // rondpoint:uniffi_uniffi_rondpoint_fn_method_retourneur_identique_i16
FfiConverterTypeRetourneur.lower(this),
FfiConverterI16.lower(value),
)
@@ -1430,7 +1444,7 @@ export class Retourneur {
throw e;
}
return UniFFIScaffolding.callAsync(
100, // rondpoint:uniffi_uniffi_rondpoint_fn_method_retourneur_identique_i32
101, // rondpoint:uniffi_uniffi_rondpoint_fn_method_retourneur_identique_i32
FfiConverterTypeRetourneur.lower(this),
FfiConverterI32.lower(value),
)
@@ -1455,7 +1469,7 @@ export class Retourneur {
throw e;
}
return UniFFIScaffolding.callAsync(
101, // rondpoint:uniffi_uniffi_rondpoint_fn_method_retourneur_identique_i64
102, // rondpoint:uniffi_uniffi_rondpoint_fn_method_retourneur_identique_i64
FfiConverterTypeRetourneur.lower(this),
FfiConverterI64.lower(value),
)
@@ -1480,7 +1494,7 @@ export class Retourneur {
throw e;
}
return UniFFIScaffolding.callAsync(
102, // rondpoint:uniffi_uniffi_rondpoint_fn_method_retourneur_identique_i8
103, // rondpoint:uniffi_uniffi_rondpoint_fn_method_retourneur_identique_i8
FfiConverterTypeRetourneur.lower(this),
FfiConverterI8.lower(value),
)
@@ -1505,7 +1519,7 @@ export class Retourneur {
throw e;
}
return UniFFIScaffolding.callAsync(
103, // rondpoint:uniffi_uniffi_rondpoint_fn_method_retourneur_identique_nombres
104, // rondpoint:uniffi_uniffi_rondpoint_fn_method_retourneur_identique_nombres
FfiConverterTypeRetourneur.lower(this),
FfiConverterTypeDictionnaireNombres.lower(value),
)
@@ -1530,7 +1544,7 @@ export class Retourneur {
throw e;
}
return UniFFIScaffolding.callAsync(
104, // rondpoint:uniffi_uniffi_rondpoint_fn_method_retourneur_identique_nombres_signes
105, // rondpoint:uniffi_uniffi_rondpoint_fn_method_retourneur_identique_nombres_signes
FfiConverterTypeRetourneur.lower(this),
FfiConverterTypeDictionnaireNombresSignes.lower(value),
)
@@ -1555,7 +1569,7 @@ export class Retourneur {
throw e;
}
return UniFFIScaffolding.callAsync(
105, // rondpoint:uniffi_uniffi_rondpoint_fn_method_retourneur_identique_optionneur_dictionnaire
106, // rondpoint:uniffi_uniffi_rondpoint_fn_method_retourneur_identique_optionneur_dictionnaire
FfiConverterTypeRetourneur.lower(this),
FfiConverterTypeOptionneurDictionnaire.lower(value),
)
@@ -1580,7 +1594,7 @@ export class Retourneur {
throw e;
}
return UniFFIScaffolding.callAsync(
106, // rondpoint:uniffi_uniffi_rondpoint_fn_method_retourneur_identique_string
107, // rondpoint:uniffi_uniffi_rondpoint_fn_method_retourneur_identique_string
FfiConverterTypeRetourneur.lower(this),
FfiConverterString.lower(value),
)
@@ -1605,7 +1619,7 @@ export class Retourneur {
throw e;
}
return UniFFIScaffolding.callAsync(
107, // rondpoint:uniffi_uniffi_rondpoint_fn_method_retourneur_identique_u16
108, // rondpoint:uniffi_uniffi_rondpoint_fn_method_retourneur_identique_u16
FfiConverterTypeRetourneur.lower(this),
FfiConverterU16.lower(value),
)
@@ -1630,7 +1644,7 @@ export class Retourneur {
throw e;
}
return UniFFIScaffolding.callAsync(
108, // rondpoint:uniffi_uniffi_rondpoint_fn_method_retourneur_identique_u32
109, // rondpoint:uniffi_uniffi_rondpoint_fn_method_retourneur_identique_u32
FfiConverterTypeRetourneur.lower(this),
FfiConverterU32.lower(value),
)
@@ -1655,7 +1669,7 @@ export class Retourneur {
throw e;
}
return UniFFIScaffolding.callAsync(
109, // rondpoint:uniffi_uniffi_rondpoint_fn_method_retourneur_identique_u64
110, // rondpoint:uniffi_uniffi_rondpoint_fn_method_retourneur_identique_u64
FfiConverterTypeRetourneur.lower(this),
FfiConverterU64.lower(value),
)
@@ -1680,7 +1694,7 @@ export class Retourneur {
throw e;
}
return UniFFIScaffolding.callAsync(
110, // rondpoint:uniffi_uniffi_rondpoint_fn_method_retourneur_identique_u8
111, // rondpoint:uniffi_uniffi_rondpoint_fn_method_retourneur_identique_u8
FfiConverterTypeRetourneur.lower(this),
FfiConverterU8.lower(value),
)
@@ -1747,7 +1761,7 @@ export class Stringifier {
const liftError = null;
const functionCall = () => {
return UniFFIScaffolding.callAsync(
124, // rondpoint:uniffi_uniffi_rondpoint_fn_constructor_stringifier_new
125, // rondpoint:uniffi_uniffi_rondpoint_fn_constructor_stringifier_new
)
}
try {
@@ -1769,7 +1783,7 @@ export class Stringifier {
throw e;
}
return UniFFIScaffolding.callAsync(
112, // rondpoint:uniffi_uniffi_rondpoint_fn_method_stringifier_to_string_boolean
113, // rondpoint:uniffi_uniffi_rondpoint_fn_method_stringifier_to_string_boolean
FfiConverterTypeStringifier.lower(this),
FfiConverterBool.lower(value),
)
@@ -1794,7 +1808,7 @@ export class Stringifier {
throw e;
}
return UniFFIScaffolding.callAsync(
113, // rondpoint:uniffi_uniffi_rondpoint_fn_method_stringifier_to_string_double
114, // rondpoint:uniffi_uniffi_rondpoint_fn_method_stringifier_to_string_double
FfiConverterTypeStringifier.lower(this),
FfiConverterF64.lower(value),
)
@@ -1819,7 +1833,7 @@ export class Stringifier {
throw e;
}
return UniFFIScaffolding.callAsync(
114, // rondpoint:uniffi_uniffi_rondpoint_fn_method_stringifier_to_string_float
115, // rondpoint:uniffi_uniffi_rondpoint_fn_method_stringifier_to_string_float
FfiConverterTypeStringifier.lower(this),
FfiConverterF32.lower(value),
)
@@ -1844,7 +1858,7 @@ export class Stringifier {
throw e;
}
return UniFFIScaffolding.callAsync(
115, // rondpoint:uniffi_uniffi_rondpoint_fn_method_stringifier_to_string_i16
116, // rondpoint:uniffi_uniffi_rondpoint_fn_method_stringifier_to_string_i16
FfiConverterTypeStringifier.lower(this),
FfiConverterI16.lower(value),
)
@@ -1869,7 +1883,7 @@ export class Stringifier {
throw e;
}
return UniFFIScaffolding.callAsync(
116, // rondpoint:uniffi_uniffi_rondpoint_fn_method_stringifier_to_string_i32
117, // rondpoint:uniffi_uniffi_rondpoint_fn_method_stringifier_to_string_i32
FfiConverterTypeStringifier.lower(this),
FfiConverterI32.lower(value),
)
@@ -1894,7 +1908,7 @@ export class Stringifier {
throw e;
}
return UniFFIScaffolding.callAsync(
117, // rondpoint:uniffi_uniffi_rondpoint_fn_method_stringifier_to_string_i64
118, // rondpoint:uniffi_uniffi_rondpoint_fn_method_stringifier_to_string_i64
FfiConverterTypeStringifier.lower(this),
FfiConverterI64.lower(value),
)
@@ -1919,7 +1933,7 @@ export class Stringifier {
throw e;
}
return UniFFIScaffolding.callAsync(
118, // rondpoint:uniffi_uniffi_rondpoint_fn_method_stringifier_to_string_i8
119, // rondpoint:uniffi_uniffi_rondpoint_fn_method_stringifier_to_string_i8
FfiConverterTypeStringifier.lower(this),
FfiConverterI8.lower(value),
)
@@ -1944,7 +1958,7 @@ export class Stringifier {
throw e;
}
return UniFFIScaffolding.callAsync(
119, // rondpoint:uniffi_uniffi_rondpoint_fn_method_stringifier_to_string_u16
120, // rondpoint:uniffi_uniffi_rondpoint_fn_method_stringifier_to_string_u16
FfiConverterTypeStringifier.lower(this),
FfiConverterU16.lower(value),
)
@@ -1969,7 +1983,7 @@ export class Stringifier {
throw e;
}
return UniFFIScaffolding.callAsync(
120, // rondpoint:uniffi_uniffi_rondpoint_fn_method_stringifier_to_string_u32
121, // rondpoint:uniffi_uniffi_rondpoint_fn_method_stringifier_to_string_u32
FfiConverterTypeStringifier.lower(this),
FfiConverterU32.lower(value),
)
@@ -1994,7 +2008,7 @@ export class Stringifier {
throw e;
}
return UniFFIScaffolding.callAsync(
121, // rondpoint:uniffi_uniffi_rondpoint_fn_method_stringifier_to_string_u64
122, // rondpoint:uniffi_uniffi_rondpoint_fn_method_stringifier_to_string_u64
FfiConverterTypeStringifier.lower(this),
FfiConverterU64.lower(value),
)
@@ -2019,7 +2033,7 @@ export class Stringifier {
throw e;
}
return UniFFIScaffolding.callAsync(
122, // rondpoint:uniffi_uniffi_rondpoint_fn_method_stringifier_to_string_u8
123, // rondpoint:uniffi_uniffi_rondpoint_fn_method_stringifier_to_string_u8
FfiConverterTypeStringifier.lower(this),
FfiConverterU8.lower(value),
)
@@ -2044,7 +2058,7 @@ export class Stringifier {
throw e;
}
return UniFFIScaffolding.callAsync(
123, // rondpoint:uniffi_uniffi_rondpoint_fn_method_stringifier_well_known_string
124, // rondpoint:uniffi_uniffi_rondpoint_fn_method_stringifier_well_known_string
FfiConverterTypeStringifier.lower(this),
FfiConverterString.lower(value),
)
@@ -3283,7 +3297,7 @@ export function copieCarte(c) {
throw e;
}
return UniFFIScaffolding.callAsync(
65, // rondpoint:uniffi_uniffi_rondpoint_fn_func_copie_carte
66, // rondpoint:uniffi_uniffi_rondpoint_fn_func_copie_carte
FfiConverterMapStringTypeEnumerationAvecDonnees.lower(c),
)
}
@@ -3308,7 +3322,7 @@ export function copieDictionnaire(d) {
throw e;
}
return UniFFIScaffolding.callAsync(
66, // rondpoint:uniffi_uniffi_rondpoint_fn_func_copie_dictionnaire
67, // rondpoint:uniffi_uniffi_rondpoint_fn_func_copie_dictionnaire
FfiConverterTypeDictionnaire.lower(d),
)
}
@@ -3333,7 +3347,7 @@ export function copieEnumeration(e) {
throw e;
}
return UniFFIScaffolding.callAsync(
67, // rondpoint:uniffi_uniffi_rondpoint_fn_func_copie_enumeration
68, // rondpoint:uniffi_uniffi_rondpoint_fn_func_copie_enumeration
FfiConverterTypeEnumeration.lower(e),
)
}
@@ -3358,7 +3372,7 @@ export function copieEnumerations(e) {
throw e;
}
return UniFFIScaffolding.callAsync(
68, // rondpoint:uniffi_uniffi_rondpoint_fn_func_copie_enumerations
69, // rondpoint:uniffi_uniffi_rondpoint_fn_func_copie_enumerations
FfiConverterSequenceTypeEnumeration.lower(e),
)
}
@@ -3383,7 +3397,7 @@ export function switcheroo(b) {
throw e;
}
return UniFFIScaffolding.callAsync(
69, // rondpoint:uniffi_uniffi_rondpoint_fn_func_switcheroo
70, // rondpoint:uniffi_uniffi_rondpoint_fn_func_switcheroo
FfiConverterBool.lower(b),
)
}

View File

@@ -154,6 +154,20 @@ class ArrayBufferDataStream {
return value;
}
readBytes() {
const size = this.readInt32();
const bytes = new Uint8Array(this.dataView.buffer, this.pos, size);
this.pos += size;
return bytes
}
writeBytes(uint8Array) {
this.writeUint32(uint8Array.length);
value.forEach((elt) => {
dataStream.writeUint8(elt);
})
}
// Reads a Sprite pointer from the data stream
// UniFFI Pointers are **always** 8 bytes long. That is enforced
// by the C++ and Rust Scaffolding code.
@@ -324,7 +338,7 @@ export class Sprite {
throw e;
}
return UniFFIScaffolding.callAsync(
129, // sprites:uniffi_uniffi_sprites_fn_constructor_sprite_new
130, // sprites:uniffi_uniffi_sprites_fn_constructor_sprite_new
FfiConverterOptionalTypePoint.lower(initialPosition),
)
}
@@ -360,7 +374,7 @@ export class Sprite {
throw e;
}
return UniFFIScaffolding.callAsync(
130, // sprites:uniffi_uniffi_sprites_fn_constructor_sprite_new_relative_to
131, // sprites:uniffi_uniffi_sprites_fn_constructor_sprite_new_relative_to
FfiConverterTypePoint.lower(reference),
FfiConverterTypeVector.lower(direction),
)
@@ -376,7 +390,7 @@ export class Sprite {
const liftError = null;
const functionCall = () => {
return UniFFIScaffolding.callAsync(
126, // sprites:uniffi_uniffi_sprites_fn_method_sprite_get_position
127, // sprites:uniffi_uniffi_sprites_fn_method_sprite_get_position
FfiConverterTypeSprite.lower(this),
)
}
@@ -400,7 +414,7 @@ export class Sprite {
throw e;
}
return UniFFIScaffolding.callAsync(
127, // sprites:uniffi_uniffi_sprites_fn_method_sprite_move_by
128, // sprites:uniffi_uniffi_sprites_fn_method_sprite_move_by
FfiConverterTypeSprite.lower(this),
FfiConverterTypeVector.lower(direction),
)
@@ -425,7 +439,7 @@ export class Sprite {
throw e;
}
return UniFFIScaffolding.callAsync(
128, // sprites:uniffi_uniffi_sprites_fn_method_sprite_move_to
129, // sprites:uniffi_uniffi_sprites_fn_method_sprite_move_to
FfiConverterTypeSprite.lower(this),
FfiConverterTypePoint.lower(position),
)
@@ -677,7 +691,7 @@ export function translate(position,direction) {
throw e;
}
return UniFFIScaffolding.callAsync(
125, // sprites:uniffi_uniffi_sprites_fn_func_translate
126, // sprites:uniffi_uniffi_sprites_fn_func_translate
FfiConverterTypePoint.lower(position),
FfiConverterTypeVector.lower(direction),
)

View File

@@ -154,6 +154,20 @@ class ArrayBufferDataStream {
return value;
}
readBytes() {
const size = this.readInt32();
const bytes = new Uint8Array(this.dataView.buffer, this.pos, size);
this.pos += size;
return bytes
}
writeBytes(uint8Array) {
this.writeUint32(uint8Array.length);
value.forEach((elt) => {
dataStream.writeUint8(elt);
})
}
// Reads a TodoList pointer from the data stream
// UniFFI Pointers are **always** 8 bytes long. That is enforced
// by the C++ and Rust Scaffolding code.
@@ -297,7 +311,7 @@ export class TodoList {
const liftError = null;
const functionCall = () => {
return UniFFIScaffolding.callAsync(
145, // todolist:uniffi_uniffi_todolist_fn_constructor_todolist_new
146, // todolist:uniffi_uniffi_todolist_fn_constructor_todolist_new
)
}
try {
@@ -319,7 +333,7 @@ export class TodoList {
throw e;
}
return UniFFIScaffolding.callAsync(
134, // todolist:uniffi_uniffi_todolist_fn_method_todolist_add_entries
135, // todolist:uniffi_uniffi_todolist_fn_method_todolist_add_entries
FfiConverterTypeTodoList.lower(this),
FfiConverterSequenceTypeTodoEntry.lower(entries),
)
@@ -344,7 +358,7 @@ export class TodoList {
throw e;
}
return UniFFIScaffolding.callAsync(
135, // todolist:uniffi_uniffi_todolist_fn_method_todolist_add_entry
136, // todolist:uniffi_uniffi_todolist_fn_method_todolist_add_entry
FfiConverterTypeTodoList.lower(this),
FfiConverterTypeTodoEntry.lower(entry),
)
@@ -369,7 +383,7 @@ export class TodoList {
throw e;
}
return UniFFIScaffolding.callAsync(
136, // todolist:uniffi_uniffi_todolist_fn_method_todolist_add_item
137, // todolist:uniffi_uniffi_todolist_fn_method_todolist_add_item
FfiConverterTypeTodoList.lower(this),
FfiConverterString.lower(todo),
)
@@ -394,7 +408,7 @@ export class TodoList {
throw e;
}
return UniFFIScaffolding.callAsync(
137, // todolist:uniffi_uniffi_todolist_fn_method_todolist_add_items
138, // todolist:uniffi_uniffi_todolist_fn_method_todolist_add_items
FfiConverterTypeTodoList.lower(this),
FfiConverterSequencestring.lower(items),
)
@@ -419,7 +433,7 @@ export class TodoList {
throw e;
}
return UniFFIScaffolding.callAsync(
138, // todolist:uniffi_uniffi_todolist_fn_method_todolist_clear_item
139, // todolist:uniffi_uniffi_todolist_fn_method_todolist_clear_item
FfiConverterTypeTodoList.lower(this),
FfiConverterString.lower(todo),
)
@@ -436,7 +450,7 @@ export class TodoList {
const liftError = null;
const functionCall = () => {
return UniFFIScaffolding.callAsync(
139, // todolist:uniffi_uniffi_todolist_fn_method_todolist_get_entries
140, // todolist:uniffi_uniffi_todolist_fn_method_todolist_get_entries
FfiConverterTypeTodoList.lower(this),
)
}
@@ -452,7 +466,7 @@ export class TodoList {
const liftError = (data) => FfiConverterTypeTodoError.lift(data);
const functionCall = () => {
return UniFFIScaffolding.callAsync(
140, // todolist:uniffi_uniffi_todolist_fn_method_todolist_get_first
141, // todolist:uniffi_uniffi_todolist_fn_method_todolist_get_first
FfiConverterTypeTodoList.lower(this),
)
}
@@ -468,7 +482,7 @@ export class TodoList {
const liftError = null;
const functionCall = () => {
return UniFFIScaffolding.callAsync(
141, // todolist:uniffi_uniffi_todolist_fn_method_todolist_get_items
142, // todolist:uniffi_uniffi_todolist_fn_method_todolist_get_items
FfiConverterTypeTodoList.lower(this),
)
}
@@ -484,7 +498,7 @@ export class TodoList {
const liftError = (data) => FfiConverterTypeTodoError.lift(data);
const functionCall = () => {
return UniFFIScaffolding.callAsync(
142, // todolist:uniffi_uniffi_todolist_fn_method_todolist_get_last
143, // todolist:uniffi_uniffi_todolist_fn_method_todolist_get_last
FfiConverterTypeTodoList.lower(this),
)
}
@@ -500,7 +514,7 @@ export class TodoList {
const liftError = (data) => FfiConverterTypeTodoError.lift(data);
const functionCall = () => {
return UniFFIScaffolding.callAsync(
143, // todolist:uniffi_uniffi_todolist_fn_method_todolist_get_last_entry
144, // todolist:uniffi_uniffi_todolist_fn_method_todolist_get_last_entry
FfiConverterTypeTodoList.lower(this),
)
}
@@ -516,7 +530,7 @@ export class TodoList {
const liftError = null;
const functionCall = () => {
return UniFFIScaffolding.callAsync(
144, // todolist:uniffi_uniffi_todolist_fn_method_todolist_make_default
145, // todolist:uniffi_uniffi_todolist_fn_method_todolist_make_default
FfiConverterTypeTodoList.lower(this),
)
}
@@ -879,7 +893,7 @@ export function createEntryWith(todo) {
throw e;
}
return UniFFIScaffolding.callAsync(
131, // todolist:uniffi_uniffi_todolist_fn_func_create_entry_with
132, // todolist:uniffi_uniffi_todolist_fn_func_create_entry_with
FfiConverterString.lower(todo),
)
}
@@ -896,7 +910,7 @@ export function getDefaultList() {
const liftError = null;
const functionCall = () => {
return UniFFIScaffolding.callAsync(
132, // todolist:uniffi_uniffi_todolist_fn_func_get_default_list
133, // todolist:uniffi_uniffi_todolist_fn_func_get_default_list
)
}
try {
@@ -920,7 +934,7 @@ export function setDefaultList(list) {
throw e;
}
return UniFFIScaffolding.callAsync(
133, // todolist:uniffi_uniffi_todolist_fn_func_set_default_list
134, // todolist:uniffi_uniffi_todolist_fn_func_set_default_list
FfiConverterTypeTodoList.lower(list),
)
}

View File

@@ -0,0 +1,21 @@
// Export the FFIConverter object to make external types work.
export class {{ ffi_converter }} extends FfiConverterArrayBuffer {
static read(dataStream) {
return dataStream.readBytes()
}
static write(dataStream, value) {
dataStream.writeBytes(value)
}
static computeSize(value) {
// The size of the length + 1 byte / item
return 4 + value.length
}
static checkType(value) {
if (!value instanceof Uint8Array) {
throw new UniFFITypeError(`${value} is not an Uint8Array`);
}
}
}

View File

@@ -144,6 +144,20 @@ class ArrayBufferDataStream {
return value;
}
readBytes() {
const size = this.readInt32();
const bytes = new Uint8Array(this.dataView.buffer, this.pos, size);
this.pos += size;
return bytes
}
writeBytes(uint8Array) {
this.writeUint32(uint8Array.length);
value.forEach((elt) => {
dataStream.writeUint8(elt);
})
}
{%- for object in ci.object_definitions() %}
// Reads a {{ object.js_name() }} pointer from the data stream

View File

@@ -49,6 +49,9 @@
{%- when Type::String %}
{%- include "String.sys.mjs" %}
{%- when Type::Bytes %}
{%- include "Bytes.sys.mjs" %}
{%- when Type::Sequence { inner_type } %}
{%- include "Sequence.sys.mjs" %}

View File

@@ -38,6 +38,7 @@ extern "C" {
RustBuffer uniffi_relevancy_fn_method_relevancystore_ingest(void*, RustBuffer, RustCallStatus*);
void uniffi_relevancy_fn_method_relevancystore_interrupt(void*, RustCallStatus*);
RustBuffer uniffi_relevancy_fn_method_relevancystore_user_interest_vector(void*, RustCallStatus*);
double uniffi_relevancy_fn_func_score(RustBuffer, RustBuffer, RustCallStatus*);
void* uniffi_remote_settings_fn_clone_remotesettings(void*, RustCallStatus*);
void uniffi_remote_settings_fn_free_remotesettings(void*, RustCallStatus*);
void* uniffi_remote_settings_fn_constructor_remotesettings_new(RustBuffer, RustCallStatus*);
@@ -299,6 +300,52 @@ Maybe<CallbackInterfaceInfo> GetCallbackInterfaceInfo(uint64_t aInterfaceId) {
// Define scaffolding call classes for each combination of return/argument types
class ScaffoldingCallHandlerUniffiRelevancyFnFuncScore : public UniffiHandlerBase {
private:
// PrepareRustArgs stores the resulting arguments in these fields
typename ScaffoldingConverter<RustBuffer>::IntermediateType mInterestVector;
typename ScaffoldingConverter<RustBuffer>::IntermediateType mContentCategories;
// MakeRustCall stores the result of the call in these fields
typename ScaffoldingConverter<double>::IntermediateType mUniffiReturnValue;
public:
void PrepareRustArgs(const dom::Sequence<dom::UniFFIScaffoldingValue>& aArgs, ErrorResult& aError) override {
ScaffoldingConverter<RustBuffer>::FromJs(aArgs[0], &mInterestVector, aError);
if (aError.Failed()) {
return;
}
ScaffoldingConverter<RustBuffer>::FromJs(aArgs[1], &mContentCategories, aError);
if (aError.Failed()) {
return;
}
}
void MakeRustCall() override {
RustCallStatus callStatus{};
mUniffiReturnValue = ScaffoldingConverter<double>::FromRust(
uniffi_relevancy_fn_func_score(
ScaffoldingConverter<RustBuffer>::IntoRust(std::move(mInterestVector)),
ScaffoldingConverter<RustBuffer>::IntoRust(std::move(mContentCategories)),
&callStatus
)
);
mUniffiCallStatusCode = callStatus.code;
if (callStatus.error_buf.data) {
mUniffiCallStatusErrorBuf = OwnedRustBuffer(callStatus.error_buf);
}
}
virtual void ExtractSuccessfulCallResult(JSContext* aCx, dom::Optional<dom::UniFFIScaffoldingValue>& aDest, ErrorResult& aError) override {
ScaffoldingConverter<double>::IntoJs(
aCx,
std::move(mUniffiReturnValue),
aDest,
aError
);
}
};
class ScaffoldingCallHandlerUniffiRelevancyFnMethodRelevancystoreCalculateMetrics : public UniffiHandlerBase {
private:
// PrepareRustArgs stores the resulting arguments in these fields
@@ -374,7 +421,7 @@ class ScaffoldingCallHandlerUniffiRelevancyFnMethodRelevancystoreIngest : public
private:
// PrepareRustArgs stores the resulting arguments in these fields
typename ScaffoldingObjectConverter<&kRelevancyRelevancyStorePointerType>::IntermediateType mPtr;
typename ScaffoldingConverter<RustBuffer>::IntermediateType mTopUrls;
typename ScaffoldingConverter<RustBuffer>::IntermediateType mTopUrlsByFrecency;
// MakeRustCall stores the result of the call in these fields
typename ScaffoldingConverter<RustBuffer>::IntermediateType mUniffiReturnValue;
@@ -385,7 +432,7 @@ public:
if (aError.Failed()) {
return;
}
ScaffoldingConverter<RustBuffer>::FromJs(aArgs[1], &mTopUrls, aError);
ScaffoldingConverter<RustBuffer>::FromJs(aArgs[1], &mTopUrlsByFrecency, aError);
if (aError.Failed()) {
return;
}
@@ -396,7 +443,7 @@ public:
mUniffiReturnValue = ScaffoldingConverter<RustBuffer>::FromRust(
uniffi_relevancy_fn_method_relevancystore_ingest(
ScaffoldingObjectConverter<&kRelevancyRelevancyStorePointerType>::IntoRust(std::move(mPtr)),
ScaffoldingConverter<RustBuffer>::IntoRust(std::move(mTopUrls)),
ScaffoldingConverter<RustBuffer>::IntoRust(std::move(mTopUrlsByFrecency)),
&callStatus
)
);
@@ -490,14 +537,14 @@ public:
class ScaffoldingCallHandlerUniffiRelevancyFnConstructorRelevancystoreNew : public UniffiHandlerBase {
private:
// PrepareRustArgs stores the resulting arguments in these fields
typename ScaffoldingConverter<RustBuffer>::IntermediateType mDbpath;
typename ScaffoldingConverter<RustBuffer>::IntermediateType mDbPath;
// MakeRustCall stores the result of the call in these fields
typename ScaffoldingObjectConverter<&kRelevancyRelevancyStorePointerType>::IntermediateType mUniffiReturnValue;
public:
void PrepareRustArgs(const dom::Sequence<dom::UniFFIScaffoldingValue>& aArgs, ErrorResult& aError) override {
ScaffoldingConverter<RustBuffer>::FromJs(aArgs[0], &mDbpath, aError);
ScaffoldingConverter<RustBuffer>::FromJs(aArgs[0], &mDbPath, aError);
if (aError.Failed()) {
return;
}
@@ -507,7 +554,7 @@ public:
RustCallStatus callStatus{};
mUniffiReturnValue = ScaffoldingObjectConverter<&kRelevancyRelevancyStorePointerType>::FromRust(
uniffi_relevancy_fn_constructor_relevancystore_new(
ScaffoldingConverter<RustBuffer>::IntoRust(std::move(mDbpath)),
ScaffoldingConverter<RustBuffer>::IntoRust(std::move(mDbPath)),
&callStatus
)
);
@@ -700,7 +747,7 @@ class ScaffoldingCallHandlerUniffiSuggestFnFuncRawSuggestionUrlMatches : public
private:
// PrepareRustArgs stores the resulting arguments in these fields
typename ScaffoldingConverter<RustBuffer>::IntermediateType mRawUrl;
typename ScaffoldingConverter<RustBuffer>::IntermediateType mUrl;
typename ScaffoldingConverter<RustBuffer>::IntermediateType mCookedUrl;
// MakeRustCall stores the result of the call in these fields
typename ScaffoldingConverter<int8_t>::IntermediateType mUniffiReturnValue;
@@ -711,7 +758,7 @@ public:
if (aError.Failed()) {
return;
}
ScaffoldingConverter<RustBuffer>::FromJs(aArgs[1], &mUrl, aError);
ScaffoldingConverter<RustBuffer>::FromJs(aArgs[1], &mCookedUrl, aError);
if (aError.Failed()) {
return;
}
@@ -722,7 +769,7 @@ public:
mUniffiReturnValue = ScaffoldingConverter<int8_t>::FromRust(
uniffi_suggest_fn_func_raw_suggestion_url_matches(
ScaffoldingConverter<RustBuffer>::IntoRust(std::move(mRawUrl)),
ScaffoldingConverter<RustBuffer>::IntoRust(std::move(mUrl)),
ScaffoldingConverter<RustBuffer>::IntoRust(std::move(mCookedUrl)),
&callStatus
)
);
@@ -808,7 +855,7 @@ class ScaffoldingCallHandlerUniffiSuggestFnMethodSuggeststoreDismissSuggestion :
private:
// PrepareRustArgs stores the resulting arguments in these fields
typename ScaffoldingObjectConverter<&kSuggestSuggestStorePointerType>::IntermediateType mPtr;
typename ScaffoldingConverter<RustBuffer>::IntermediateType mRawSuggestionUrl;
typename ScaffoldingConverter<RustBuffer>::IntermediateType mSuggestionUrl;
// MakeRustCall stores the result of the call in these fields
@@ -818,7 +865,7 @@ public:
if (aError.Failed()) {
return;
}
ScaffoldingConverter<RustBuffer>::FromJs(aArgs[1], &mRawSuggestionUrl, aError);
ScaffoldingConverter<RustBuffer>::FromJs(aArgs[1], &mSuggestionUrl, aError);
if (aError.Failed()) {
return;
}
@@ -828,7 +875,7 @@ public:
RustCallStatus callStatus{};
uniffi_suggest_fn_method_suggeststore_dismiss_suggestion(
ScaffoldingObjectConverter<&kSuggestSuggestStorePointerType>::IntoRust(std::move(mPtr)),
ScaffoldingConverter<RustBuffer>::IntoRust(std::move(mRawSuggestionUrl)),
ScaffoldingConverter<RustBuffer>::IntoRust(std::move(mSuggestionUrl)),
&callStatus
);
@@ -1284,8 +1331,8 @@ class ScaffoldingCallHandlerUniffiSuggestFnMethodSuggeststorebuilderLoadExtensio
private:
// PrepareRustArgs stores the resulting arguments in these fields
typename ScaffoldingObjectConverter<&kSuggestSuggestStoreBuilderPointerType>::IntermediateType mPtr;
typename ScaffoldingConverter<RustBuffer>::IntermediateType mLibraryName;
typename ScaffoldingConverter<RustBuffer>::IntermediateType mEntrypoint;
typename ScaffoldingConverter<RustBuffer>::IntermediateType mLibrary;
typename ScaffoldingConverter<RustBuffer>::IntermediateType mEntryPoint;
// MakeRustCall stores the result of the call in these fields
typename ScaffoldingObjectConverter<&kSuggestSuggestStoreBuilderPointerType>::IntermediateType mUniffiReturnValue;
@@ -1296,11 +1343,11 @@ public:
if (aError.Failed()) {
return;
}
ScaffoldingConverter<RustBuffer>::FromJs(aArgs[1], &mLibraryName, aError);
ScaffoldingConverter<RustBuffer>::FromJs(aArgs[1], &mLibrary, aError);
if (aError.Failed()) {
return;
}
ScaffoldingConverter<RustBuffer>::FromJs(aArgs[2], &mEntrypoint, aError);
ScaffoldingConverter<RustBuffer>::FromJs(aArgs[2], &mEntryPoint, aError);
if (aError.Failed()) {
return;
}
@@ -1311,8 +1358,8 @@ public:
mUniffiReturnValue = ScaffoldingObjectConverter<&kSuggestSuggestStoreBuilderPointerType>::FromRust(
uniffi_suggest_fn_method_suggeststorebuilder_load_extension(
ScaffoldingObjectConverter<&kSuggestSuggestStoreBuilderPointerType>::IntoRust(std::move(mPtr)),
ScaffoldingConverter<RustBuffer>::IntoRust(std::move(mLibraryName)),
ScaffoldingConverter<RustBuffer>::IntoRust(std::move(mEntrypoint)),
ScaffoldingConverter<RustBuffer>::IntoRust(std::move(mLibrary)),
ScaffoldingConverter<RustBuffer>::IntoRust(std::move(mEntryPoint)),
&callStatus
)
);
@@ -6447,443 +6494,446 @@ UniquePtr<UniffiHandlerBase> GetHandler(uint64_t aId) {
switch (aId) {
case 0: {
return MakeUnique<ScaffoldingCallHandlerUniffiRelevancyFnMethodRelevancystoreCalculateMetrics>();
return MakeUnique<ScaffoldingCallHandlerUniffiRelevancyFnFuncScore>();
}
case 1: {
return MakeUnique<ScaffoldingCallHandlerUniffiRelevancyFnMethodRelevancystoreClose>();
return MakeUnique<ScaffoldingCallHandlerUniffiRelevancyFnMethodRelevancystoreCalculateMetrics>();
}
case 2: {
return MakeUnique<ScaffoldingCallHandlerUniffiRelevancyFnMethodRelevancystoreIngest>();
return MakeUnique<ScaffoldingCallHandlerUniffiRelevancyFnMethodRelevancystoreClose>();
}
case 3: {
return MakeUnique<ScaffoldingCallHandlerUniffiRelevancyFnMethodRelevancystoreInterrupt>();
return MakeUnique<ScaffoldingCallHandlerUniffiRelevancyFnMethodRelevancystoreIngest>();
}
case 4: {
return MakeUnique<ScaffoldingCallHandlerUniffiRelevancyFnMethodRelevancystoreUserInterestVector>();
return MakeUnique<ScaffoldingCallHandlerUniffiRelevancyFnMethodRelevancystoreInterrupt>();
}
case 5: {
return MakeUnique<ScaffoldingCallHandlerUniffiRelevancyFnConstructorRelevancystoreNew>();
return MakeUnique<ScaffoldingCallHandlerUniffiRelevancyFnMethodRelevancystoreUserInterestVector>();
}
case 6: {
return MakeUnique<ScaffoldingCallHandlerUniffiRemoteSettingsFnMethodRemotesettingsDownloadAttachmentToPath>();
return MakeUnique<ScaffoldingCallHandlerUniffiRelevancyFnConstructorRelevancystoreNew>();
}
case 7: {
return MakeUnique<ScaffoldingCallHandlerUniffiRemoteSettingsFnMethodRemotesettingsGetRecords>();
return MakeUnique<ScaffoldingCallHandlerUniffiRemoteSettingsFnMethodRemotesettingsDownloadAttachmentToPath>();
}
case 8: {
return MakeUnique<ScaffoldingCallHandlerUniffiRemoteSettingsFnMethodRemotesettingsGetRecordsSince>();
return MakeUnique<ScaffoldingCallHandlerUniffiRemoteSettingsFnMethodRemotesettingsGetRecords>();
}
case 9: {
return MakeUnique<ScaffoldingCallHandlerUniffiRemoteSettingsFnConstructorRemotesettingsNew>();
return MakeUnique<ScaffoldingCallHandlerUniffiRemoteSettingsFnMethodRemotesettingsGetRecordsSince>();
}
case 10: {
return MakeUnique<ScaffoldingCallHandlerUniffiSuggestFnFuncRawSuggestionUrlMatches>();
return MakeUnique<ScaffoldingCallHandlerUniffiRemoteSettingsFnConstructorRemotesettingsNew>();
}
case 11: {
return MakeUnique<ScaffoldingCallHandlerUniffiSuggestFnMethodSuggeststoreClear>();
return MakeUnique<ScaffoldingCallHandlerUniffiSuggestFnFuncRawSuggestionUrlMatches>();
}
case 12: {
return MakeUnique<ScaffoldingCallHandlerUniffiSuggestFnMethodSuggeststoreClearDismissedSuggestions>();
return MakeUnique<ScaffoldingCallHandlerUniffiSuggestFnMethodSuggeststoreClear>();
}
case 13: {
return MakeUnique<ScaffoldingCallHandlerUniffiSuggestFnMethodSuggeststoreDismissSuggestion>();
return MakeUnique<ScaffoldingCallHandlerUniffiSuggestFnMethodSuggeststoreClearDismissedSuggestions>();
}
case 14: {
return MakeUnique<ScaffoldingCallHandlerUniffiSuggestFnMethodSuggeststoreFetchGlobalConfig>();
return MakeUnique<ScaffoldingCallHandlerUniffiSuggestFnMethodSuggeststoreDismissSuggestion>();
}
case 15: {
return MakeUnique<ScaffoldingCallHandlerUniffiSuggestFnMethodSuggeststoreFetchProviderConfig>();
return MakeUnique<ScaffoldingCallHandlerUniffiSuggestFnMethodSuggeststoreFetchGlobalConfig>();
}
case 16: {
return MakeUnique<ScaffoldingCallHandlerUniffiSuggestFnMethodSuggeststoreIngest>();
return MakeUnique<ScaffoldingCallHandlerUniffiSuggestFnMethodSuggeststoreFetchProviderConfig>();
}
case 17: {
return MakeUnique<ScaffoldingCallHandlerUniffiSuggestFnMethodSuggeststoreInterrupt>();
return MakeUnique<ScaffoldingCallHandlerUniffiSuggestFnMethodSuggeststoreIngest>();
}
case 18: {
return MakeUnique<ScaffoldingCallHandlerUniffiSuggestFnMethodSuggeststoreQuery>();
return MakeUnique<ScaffoldingCallHandlerUniffiSuggestFnMethodSuggeststoreInterrupt>();
}
case 19: {
return MakeUnique<ScaffoldingCallHandlerUniffiSuggestFnMethodSuggeststoreQueryWithMetrics>();
return MakeUnique<ScaffoldingCallHandlerUniffiSuggestFnMethodSuggeststoreQuery>();
}
case 20: {
return MakeUnique<ScaffoldingCallHandlerUniffiSuggestFnConstructorSuggeststoreNew>();
return MakeUnique<ScaffoldingCallHandlerUniffiSuggestFnMethodSuggeststoreQueryWithMetrics>();
}
case 21: {
return MakeUnique<ScaffoldingCallHandlerUniffiSuggestFnMethodSuggeststorebuilderBuild>();
return MakeUnique<ScaffoldingCallHandlerUniffiSuggestFnConstructorSuggeststoreNew>();
}
case 22: {
return MakeUnique<ScaffoldingCallHandlerUniffiSuggestFnMethodSuggeststorebuilderCachePath>();
return MakeUnique<ScaffoldingCallHandlerUniffiSuggestFnMethodSuggeststorebuilderBuild>();
}
case 23: {
return MakeUnique<ScaffoldingCallHandlerUniffiSuggestFnMethodSuggeststorebuilderDataPath>();
return MakeUnique<ScaffoldingCallHandlerUniffiSuggestFnMethodSuggeststorebuilderCachePath>();
}
case 24: {
return MakeUnique<ScaffoldingCallHandlerUniffiSuggestFnMethodSuggeststorebuilderLoadExtension>();
return MakeUnique<ScaffoldingCallHandlerUniffiSuggestFnMethodSuggeststorebuilderDataPath>();
}
case 25: {
return MakeUnique<ScaffoldingCallHandlerUniffiSuggestFnMethodSuggeststorebuilderRemoteSettingsBucketName>();
return MakeUnique<ScaffoldingCallHandlerUniffiSuggestFnMethodSuggeststorebuilderLoadExtension>();
}
case 26: {
return MakeUnique<ScaffoldingCallHandlerUniffiSuggestFnMethodSuggeststorebuilderRemoteSettingsServer>();
return MakeUnique<ScaffoldingCallHandlerUniffiSuggestFnMethodSuggeststorebuilderRemoteSettingsBucketName>();
}
case 27: {
return MakeUnique<ScaffoldingCallHandlerUniffiSuggestFnConstructorSuggeststorebuilderNew>();
return MakeUnique<ScaffoldingCallHandlerUniffiSuggestFnMethodSuggeststorebuilderRemoteSettingsServer>();
}
case 28: {
return MakeUnique<ScaffoldingCallHandlerUniffiTabsFnMethodRemotecommandstoreAddRemoteCommand>();
return MakeUnique<ScaffoldingCallHandlerUniffiSuggestFnConstructorSuggeststorebuilderNew>();
}
case 29: {
return MakeUnique<ScaffoldingCallHandlerUniffiTabsFnMethodRemotecommandstoreAddRemoteCommandAt>();
return MakeUnique<ScaffoldingCallHandlerUniffiTabsFnMethodRemotecommandstoreAddRemoteCommand>();
}
case 30: {
return MakeUnique<ScaffoldingCallHandlerUniffiTabsFnMethodRemotecommandstoreGetUnsentCommands>();
return MakeUnique<ScaffoldingCallHandlerUniffiTabsFnMethodRemotecommandstoreAddRemoteCommandAt>();
}
case 31: {
return MakeUnique<ScaffoldingCallHandlerUniffiTabsFnMethodRemotecommandstoreRemoveRemoteCommand>();
return MakeUnique<ScaffoldingCallHandlerUniffiTabsFnMethodRemotecommandstoreGetUnsentCommands>();
}
case 32: {
return MakeUnique<ScaffoldingCallHandlerUniffiTabsFnMethodRemotecommandstoreSetPendingCommandSent>();
return MakeUnique<ScaffoldingCallHandlerUniffiTabsFnMethodRemotecommandstoreRemoveRemoteCommand>();
}
case 33: {
return MakeUnique<ScaffoldingCallHandlerUniffiTabsFnMethodTabsbridgedengineApply>();
return MakeUnique<ScaffoldingCallHandlerUniffiTabsFnMethodRemotecommandstoreSetPendingCommandSent>();
}
case 34: {
return MakeUnique<ScaffoldingCallHandlerUniffiTabsFnMethodTabsbridgedengineEnsureCurrentSyncId>();
return MakeUnique<ScaffoldingCallHandlerUniffiTabsFnMethodTabsbridgedengineApply>();
}
case 35: {
return MakeUnique<ScaffoldingCallHandlerUniffiTabsFnMethodTabsbridgedengineLastSync>();
return MakeUnique<ScaffoldingCallHandlerUniffiTabsFnMethodTabsbridgedengineEnsureCurrentSyncId>();
}
case 36: {
return MakeUnique<ScaffoldingCallHandlerUniffiTabsFnMethodTabsbridgedenginePrepareForSync>();
return MakeUnique<ScaffoldingCallHandlerUniffiTabsFnMethodTabsbridgedengineLastSync>();
}
case 37: {
return MakeUnique<ScaffoldingCallHandlerUniffiTabsFnMethodTabsbridgedengineReset>();
return MakeUnique<ScaffoldingCallHandlerUniffiTabsFnMethodTabsbridgedenginePrepareForSync>();
}
case 38: {
return MakeUnique<ScaffoldingCallHandlerUniffiTabsFnMethodTabsbridgedengineResetSyncId>();
return MakeUnique<ScaffoldingCallHandlerUniffiTabsFnMethodTabsbridgedengineReset>();
}
case 39: {
return MakeUnique<ScaffoldingCallHandlerUniffiTabsFnMethodTabsbridgedengineSetLastSync>();
return MakeUnique<ScaffoldingCallHandlerUniffiTabsFnMethodTabsbridgedengineResetSyncId>();
}
case 40: {
return MakeUnique<ScaffoldingCallHandlerUniffiTabsFnMethodTabsbridgedengineSetUploaded>();
return MakeUnique<ScaffoldingCallHandlerUniffiTabsFnMethodTabsbridgedengineSetLastSync>();
}
case 41: {
return MakeUnique<ScaffoldingCallHandlerUniffiTabsFnMethodTabsbridgedengineStoreIncoming>();
return MakeUnique<ScaffoldingCallHandlerUniffiTabsFnMethodTabsbridgedengineSetUploaded>();
}
case 42: {
return MakeUnique<ScaffoldingCallHandlerUniffiTabsFnMethodTabsbridgedengineSyncFinished>();
return MakeUnique<ScaffoldingCallHandlerUniffiTabsFnMethodTabsbridgedengineStoreIncoming>();
}
case 43: {
return MakeUnique<ScaffoldingCallHandlerUniffiTabsFnMethodTabsbridgedengineSyncId>();
return MakeUnique<ScaffoldingCallHandlerUniffiTabsFnMethodTabsbridgedengineSyncFinished>();
}
case 44: {
return MakeUnique<ScaffoldingCallHandlerUniffiTabsFnMethodTabsbridgedengineSyncStarted>();
return MakeUnique<ScaffoldingCallHandlerUniffiTabsFnMethodTabsbridgedengineSyncId>();
}
case 45: {
return MakeUnique<ScaffoldingCallHandlerUniffiTabsFnMethodTabsbridgedengineWipe>();
return MakeUnique<ScaffoldingCallHandlerUniffiTabsFnMethodTabsbridgedengineSyncStarted>();
}
case 46: {
return MakeUnique<ScaffoldingCallHandlerUniffiTabsFnMethodTabsstoreBridgedEngine>();
return MakeUnique<ScaffoldingCallHandlerUniffiTabsFnMethodTabsbridgedengineWipe>();
}
case 47: {
return MakeUnique<ScaffoldingCallHandlerUniffiTabsFnMethodTabsstoreCloseConnection>();
return MakeUnique<ScaffoldingCallHandlerUniffiTabsFnMethodTabsstoreBridgedEngine>();
}
case 48: {
return MakeUnique<ScaffoldingCallHandlerUniffiTabsFnMethodTabsstoreGetAll>();
return MakeUnique<ScaffoldingCallHandlerUniffiTabsFnMethodTabsstoreCloseConnection>();
}
case 49: {
return MakeUnique<ScaffoldingCallHandlerUniffiTabsFnMethodTabsstoreNewRemoteCommandStore>();
return MakeUnique<ScaffoldingCallHandlerUniffiTabsFnMethodTabsstoreGetAll>();
}
case 50: {
return MakeUnique<ScaffoldingCallHandlerUniffiTabsFnMethodTabsstoreRegisterWithSyncManager>();
return MakeUnique<ScaffoldingCallHandlerUniffiTabsFnMethodTabsstoreNewRemoteCommandStore>();
}
case 51: {
return MakeUnique<ScaffoldingCallHandlerUniffiTabsFnMethodTabsstoreSetLocalTabs>();
return MakeUnique<ScaffoldingCallHandlerUniffiTabsFnMethodTabsstoreRegisterWithSyncManager>();
}
case 52: {
return MakeUnique<ScaffoldingCallHandlerUniffiTabsFnMethodTabsstoreSetLocalTabs>();
}
case 53: {
return MakeUnique<ScaffoldingCallHandlerUniffiTabsFnConstructorTabsstoreNew>();
}
#ifdef MOZ_UNIFFI_FIXTURES
case 53: {
case 54: {
return MakeUnique<ScaffoldingCallHandlerUniffiArithmeticalFnFuncAdd>();
}
case 54: {
case 55: {
return MakeUnique<ScaffoldingCallHandlerUniffiArithmeticalFnFuncDiv>();
}
case 55: {
case 56: {
return MakeUnique<ScaffoldingCallHandlerUniffiArithmeticalFnFuncEqual>();
}
case 56: {
case 57: {
return MakeUnique<ScaffoldingCallHandlerUniffiArithmeticalFnFuncSub>();
}
case 57: {
case 58: {
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiCustomTypesFnFuncGetCustomTypesDemo>();
}
case 58: {
case 59: {
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiFixtureExternalTypesFnFuncGradient>();
}
case 59: {
case 60: {
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiFixtureExternalTypesFnFuncIntersection>();
}
case 60: {
case 61: {
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiGeometryFnFuncGradient>();
}
case 61: {
case 62: {
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiGeometryFnFuncIntersection>();
}
case 62: {
case 63: {
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiFixtureRefcountsFnFuncGetJsRefcount>();
}
case 63: {
case 64: {
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiFixtureRefcountsFnFuncGetSingleton>();
}
case 64: {
case 65: {
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiFixtureRefcountsFnMethodSingletonobjectMethod>();
}
case 65: {
case 66: {
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnFuncCopieCarte>();
}
case 66: {
case 67: {
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnFuncCopieDictionnaire>();
}
case 67: {
case 68: {
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnFuncCopieEnumeration>();
}
case 68: {
case 69: {
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnFuncCopieEnumerations>();
}
case 69: {
case 70: {
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnFuncSwitcheroo>();
}
case 70: {
case 71: {
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnMethodOptionneurSinonBoolean>();
}
case 71: {
case 72: {
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnMethodOptionneurSinonEnum>();
}
case 72: {
case 73: {
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnMethodOptionneurSinonF32>();
}
case 73: {
case 74: {
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnMethodOptionneurSinonF64>();
}
case 74: {
case 75: {
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnMethodOptionneurSinonI16Dec>();
}
case 75: {
case 76: {
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnMethodOptionneurSinonI16Hex>();
}
case 76: {
case 77: {
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnMethodOptionneurSinonI32Dec>();
}
case 77: {
case 78: {
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnMethodOptionneurSinonI32Hex>();
}
case 78: {
case 79: {
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnMethodOptionneurSinonI64Dec>();
}
case 79: {
case 80: {
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnMethodOptionneurSinonI64Hex>();
}
case 80: {
case 81: {
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnMethodOptionneurSinonI8Dec>();
}
case 81: {
case 82: {
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnMethodOptionneurSinonI8Hex>();
}
case 82: {
case 83: {
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnMethodOptionneurSinonNull>();
}
case 83: {
case 84: {
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnMethodOptionneurSinonSequence>();
}
case 84: {
case 85: {
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnMethodOptionneurSinonString>();
}
case 85: {
case 86: {
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnMethodOptionneurSinonU16Dec>();
}
case 86: {
case 87: {
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnMethodOptionneurSinonU16Hex>();
}
case 87: {
case 88: {
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnMethodOptionneurSinonU32Dec>();
}
case 88: {
case 89: {
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnMethodOptionneurSinonU32Hex>();
}
case 89: {
case 90: {
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnMethodOptionneurSinonU32Oct>();
}
case 90: {
case 91: {
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnMethodOptionneurSinonU64Dec>();
}
case 91: {
case 92: {
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnMethodOptionneurSinonU64Hex>();
}
case 92: {
case 93: {
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnMethodOptionneurSinonU8Dec>();
}
case 93: {
case 94: {
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnMethodOptionneurSinonU8Hex>();
}
case 94: {
case 95: {
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnMethodOptionneurSinonZero>();
}
case 95: {
case 96: {
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnConstructorOptionneurNew>();
}
case 96: {
case 97: {
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnMethodRetourneurIdentiqueBoolean>();
}
case 97: {
case 98: {
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnMethodRetourneurIdentiqueDouble>();
}
case 98: {
case 99: {
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnMethodRetourneurIdentiqueFloat>();
}
case 99: {
case 100: {
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnMethodRetourneurIdentiqueI16>();
}
case 100: {
case 101: {
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnMethodRetourneurIdentiqueI32>();
}
case 101: {
case 102: {
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnMethodRetourneurIdentiqueI64>();
}
case 102: {
case 103: {
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnMethodRetourneurIdentiqueI8>();
}
case 103: {
case 104: {
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnMethodRetourneurIdentiqueNombres>();
}
case 104: {
case 105: {
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnMethodRetourneurIdentiqueNombresSignes>();
}
case 105: {
case 106: {
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnMethodRetourneurIdentiqueOptionneurDictionnaire>();
}
case 106: {
case 107: {
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnMethodRetourneurIdentiqueString>();
}
case 107: {
case 108: {
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnMethodRetourneurIdentiqueU16>();
}
case 108: {
case 109: {
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnMethodRetourneurIdentiqueU32>();
}
case 109: {
case 110: {
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnMethodRetourneurIdentiqueU64>();
}
case 110: {
case 111: {
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnMethodRetourneurIdentiqueU8>();
}
case 111: {
case 112: {
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnConstructorRetourneurNew>();
}
case 112: {
case 113: {
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnMethodStringifierToStringBoolean>();
}
case 113: {
case 114: {
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnMethodStringifierToStringDouble>();
}
case 114: {
case 115: {
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnMethodStringifierToStringFloat>();
}
case 115: {
case 116: {
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnMethodStringifierToStringI16>();
}
case 116: {
case 117: {
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnMethodStringifierToStringI32>();
}
case 117: {
case 118: {
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnMethodStringifierToStringI64>();
}
case 118: {
case 119: {
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnMethodStringifierToStringI8>();
}
case 119: {
case 120: {
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnMethodStringifierToStringU16>();
}
case 120: {
case 121: {
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnMethodStringifierToStringU32>();
}
case 121: {
case 122: {
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnMethodStringifierToStringU64>();
}
case 122: {
case 123: {
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnMethodStringifierToStringU8>();
}
case 123: {
case 124: {
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnMethodStringifierWellKnownString>();
}
case 124: {
case 125: {
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnConstructorStringifierNew>();
}
case 125: {
case 126: {
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiSpritesFnFuncTranslate>();
}
case 126: {
case 127: {
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiSpritesFnMethodSpriteGetPosition>();
}
case 127: {
case 128: {
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiSpritesFnMethodSpriteMoveBy>();
}
case 128: {
case 129: {
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiSpritesFnMethodSpriteMoveTo>();
}
case 129: {
case 130: {
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiSpritesFnConstructorSpriteNew>();
}
case 130: {
case 131: {
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiSpritesFnConstructorSpriteNewRelativeTo>();
}
case 131: {
case 132: {
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiTodolistFnFuncCreateEntryWith>();
}
case 132: {
case 133: {
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiTodolistFnFuncGetDefaultList>();
}
case 133: {
case 134: {
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiTodolistFnFuncSetDefaultList>();
}
case 134: {
case 135: {
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiTodolistFnMethodTodolistAddEntries>();
}
case 135: {
case 136: {
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiTodolistFnMethodTodolistAddEntry>();
}
case 136: {
case 137: {
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiTodolistFnMethodTodolistAddItem>();
}
case 137: {
case 138: {
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiTodolistFnMethodTodolistAddItems>();
}
case 138: {
case 139: {
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiTodolistFnMethodTodolistClearItem>();
}
case 139: {
case 140: {
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiTodolistFnMethodTodolistGetEntries>();
}
case 140: {
case 141: {
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiTodolistFnMethodTodolistGetFirst>();
}
case 141: {
case 142: {
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiTodolistFnMethodTodolistGetItems>();
}
case 142: {
case 143: {
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiTodolistFnMethodTodolistGetLast>();
}
case 143: {
case 144: {
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiTodolistFnMethodTodolistGetLastEntry>();
}
case 144: {
case 145: {
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiTodolistFnMethodTodolistMakeDefault>();
}
case 145: {
case 146: {
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiTodolistFnConstructorTodolistNew>();
}
#endif /* MOZ_UNIFFI_FIXTURES */