Bug 1952588 - Vendor application-services to 138 for Suggest geo expansion. r=bdk,daisuke
This vendors the `desktop-138` branch [1] of application-services. The `main` branch currently does not have some PRs that desktop needs because they break mobile, and we need this on desktop ASAP. This patch is larger than usual because the vendor includes some major changes to the application-services `suggest` component, including new and changed API. As a consequence this patch includes the following important changes: ## New `suggest` API & uniffi `SuggestStoreBuilder::remote_settings_service` and `RemoteSettingsService::new` are exposed to JS as synchronous functions. There's no need for them to be off-main-thread. ## Telemetry The labels of `suggest.ingest_time`, `ingest_download_time` and `query_time` had to be updated due to changes in the Rust component. These are minor updates that don't need a data review. ## Urlbar I had to make the following changes to urlbar. I tried to keep them to a minimum for now. There are opportunities for improvements in follow-ups. * Appropriate minimal integration changes to `SuggestBackendRust` for creating the `SuggestStore` and setting up the RS config * The Rust component uses new RS collections, which breaks tests. I tried to fix them without touching too many lines. There are definitely opportunities to improve these tests and test helpers that I'd like to come back to. * A fix to `RemoteSettingsServer` that's required due to the new RS client used by the Rust component ## Late writes due to the new RS client & `AsyncShutdown` This is a urlbar change but it's worth calling out separately. I pushed all these changes to tryserver, and there was a failure at the end of the browser Suggest tests due to `LateWriteObserver` [2]. The late write happens when the app exits: `SuggestStore` is dropped, which causes the new app-services RS client to drop its Sqlite connection, which causes Sqlite to sync the RS client's DB to disk. This hasn't been a problem before because `suggest` currently uses the old RS client, which doesn't keep a DB. (`suggest` does have its own separate Sqlite DB, and I didn't investigate why this isn't a problem for it, mainly because it makes sense that the new RS client would sync its DB when it's dropped and that might be considered a "late write" when it happens on app shutdown.) According to the stack in the log, `SuggestStore` is dropped by `nsCycleCollector`. I can't see how `SuggestBackendRust.#store` is involved in a cycle, and I don't know if something in this patch is causing a cycle where there wasn't one before. Maybe there always was. And I don't know if the cycle is what's causing the all this to happen too late on shutdown. Maybe it's unrelated. (I'll paste the stack in a Phabricator comment.) The `SuggestStore` is definitely kept alive until `AsyncShutdown.profileBeforeChange` since we have a barrier for that phase that calls `interrupt()` on it. Maybe that's simply the problem and we're using a phase that's too late in shutdown. But again I don't know why it wouldn't also be a problem for Suggest's own DB. The only fix I found is to replace `AsyncShutdown.profileBeforeChange` with either `quitApplicationGranted` or `profileChangeTeardown`, and then null out `#store` in the callback (after we call `interrupt()` on it). I assume that fixes it because `profileBeforeChange` runs later than those other two phases. So I replaced `profileBeforeChange` with `profileChangeTeardown`. I don't know which of `quitApplicationGranted` or `profileChangeTeardown` is better. I think it probably doesn't matter. I chose `profileChangeTeardown` because it's closer to `profileBeforeChange`. (The order is: `quitApplicationGranted`, `profileChangeTeardown`, `profileBeforeChange`.) [1] https://github.com/mozilla/application-services/tree/desktop-138 [2] https://treeherder.mozilla.org/jobs?repo=try&revision=1639f87aa46f1afaf50901d80c8282861700019b Differential Revision: https://phabricator.services.mozilla.com/D240919
This commit is contained in:
@@ -70,9 +70,9 @@ git = "https://github.com/jfkthame/mapped_hyph.git"
|
||||
rev = "eff105f6ad7ec9b79816cfc1985a28e5340ad14b"
|
||||
replace-with = "vendored-sources"
|
||||
|
||||
[source."git+https://github.com/mozilla/application-services?rev=f7947a60b3e9957b97229d6dd08b458532e79c1c"]
|
||||
[source."git+https://github.com/mozilla/application-services?branch=desktop-138"]
|
||||
git = "https://github.com/mozilla/application-services"
|
||||
rev = "f7947a60b3e9957b97229d6dd08b458532e79c1c"
|
||||
branch = "desktop-138"
|
||||
replace-with = "vendored-sources"
|
||||
|
||||
[source."git+https://github.com/mozilla/audioipc?rev=e6f44a2bd1e57d11dfc737632a9e849077632330"]
|
||||
|
||||
32
Cargo.lock
generated
32
Cargo.lock
generated
@@ -1802,7 +1802,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "error-support"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/mozilla/application-services?rev=f7947a60b3e9957b97229d6dd08b458532e79c1c#f7947a60b3e9957b97229d6dd08b458532e79c1c"
|
||||
source = "git+https://github.com/mozilla/application-services?branch=desktop-138#52a67ed74c51d23b962de4e002e088bee5e5d24e"
|
||||
dependencies = [
|
||||
"error-support-macros",
|
||||
"lazy_static",
|
||||
@@ -1814,7 +1814,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "error-support-macros"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/mozilla/application-services?rev=f7947a60b3e9957b97229d6dd08b458532e79c1c#f7947a60b3e9957b97229d6dd08b458532e79c1c"
|
||||
source = "git+https://github.com/mozilla/application-services?branch=desktop-138#52a67ed74c51d23b962de4e002e088bee5e5d24e"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
@@ -1931,7 +1931,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "firefox-versioning"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/mozilla/application-services?rev=f7947a60b3e9957b97229d6dd08b458532e79c1c#f7947a60b3e9957b97229d6dd08b458532e79c1c"
|
||||
source = "git+https://github.com/mozilla/application-services?branch=desktop-138#52a67ed74c51d23b962de4e002e088bee5e5d24e"
|
||||
dependencies = [
|
||||
"serde_json",
|
||||
"thiserror 1.999.999",
|
||||
@@ -3216,7 +3216,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "interrupt-support"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/mozilla/application-services?rev=f7947a60b3e9957b97229d6dd08b458532e79c1c#f7947a60b3e9957b97229d6dd08b458532e79c1c"
|
||||
source = "git+https://github.com/mozilla/application-services?branch=desktop-138#52a67ed74c51d23b962de4e002e088bee5e5d24e"
|
||||
dependencies = [
|
||||
"lazy_static",
|
||||
"parking_lot",
|
||||
@@ -4920,7 +4920,7 @@ checksum = "d01a5bd0424d00070b0098dd17ebca6f961a959dead1dbcbbbc1d1cd8d3deeba"
|
||||
[[package]]
|
||||
name = "payload-support"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/mozilla/application-services?rev=f7947a60b3e9957b97229d6dd08b458532e79c1c#f7947a60b3e9957b97229d6dd08b458532e79c1c"
|
||||
source = "git+https://github.com/mozilla/application-services?branch=desktop-138#52a67ed74c51d23b962de4e002e088bee5e5d24e"
|
||||
dependencies = [
|
||||
"serde",
|
||||
"serde_derive",
|
||||
@@ -5416,7 +5416,7 @@ checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da"
|
||||
[[package]]
|
||||
name = "relevancy"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/mozilla/application-services?rev=f7947a60b3e9957b97229d6dd08b458532e79c1c#f7947a60b3e9957b97229d6dd08b458532e79c1c"
|
||||
source = "git+https://github.com/mozilla/application-services?branch=desktop-138#52a67ed74c51d23b962de4e002e088bee5e5d24e"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"base64 0.21.3",
|
||||
@@ -5441,7 +5441,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "remote_settings"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/mozilla/application-services?rev=f7947a60b3e9957b97229d6dd08b458532e79c1c#f7947a60b3e9957b97229d6dd08b458532e79c1c"
|
||||
source = "git+https://github.com/mozilla/application-services?branch=desktop-138#52a67ed74c51d23b962de4e002e088bee5e5d24e"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"camino",
|
||||
@@ -5724,7 +5724,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "search"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/mozilla/application-services?rev=f7947a60b3e9957b97229d6dd08b458532e79c1c#f7947a60b3e9957b97229d6dd08b458532e79c1c"
|
||||
source = "git+https://github.com/mozilla/application-services?branch=desktop-138#52a67ed74c51d23b962de4e002e088bee5e5d24e"
|
||||
dependencies = [
|
||||
"error-support",
|
||||
"firefox-versioning",
|
||||
@@ -6014,7 +6014,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "sql-support"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/mozilla/application-services?rev=f7947a60b3e9957b97229d6dd08b458532e79c1c#f7947a60b3e9957b97229d6dd08b458532e79c1c"
|
||||
source = "git+https://github.com/mozilla/application-services?branch=desktop-138#52a67ed74c51d23b962de4e002e088bee5e5d24e"
|
||||
dependencies = [
|
||||
"interrupt-support",
|
||||
"lazy_static",
|
||||
@@ -6214,7 +6214,7 @@ checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc"
|
||||
[[package]]
|
||||
name = "suggest"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/mozilla/application-services?rev=f7947a60b3e9957b97229d6dd08b458532e79c1c#f7947a60b3e9957b97229d6dd08b458532e79c1c"
|
||||
source = "git+https://github.com/mozilla/application-services?branch=desktop-138#52a67ed74c51d23b962de4e002e088bee5e5d24e"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"chrono",
|
||||
@@ -6266,7 +6266,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "sync-guid"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/mozilla/application-services?rev=f7947a60b3e9957b97229d6dd08b458532e79c1c#f7947a60b3e9957b97229d6dd08b458532e79c1c"
|
||||
source = "git+https://github.com/mozilla/application-services?branch=desktop-138#52a67ed74c51d23b962de4e002e088bee5e5d24e"
|
||||
dependencies = [
|
||||
"base64 0.21.3",
|
||||
"rand",
|
||||
@@ -6277,7 +6277,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "sync15"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/mozilla/application-services?rev=f7947a60b3e9957b97229d6dd08b458532e79c1c#f7947a60b3e9957b97229d6dd08b458532e79c1c"
|
||||
source = "git+https://github.com/mozilla/application-services?branch=desktop-138#52a67ed74c51d23b962de4e002e088bee5e5d24e"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"error-support",
|
||||
@@ -6317,7 +6317,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "tabs"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/mozilla/application-services?rev=f7947a60b3e9957b97229d6dd08b458532e79c1c#f7947a60b3e9957b97229d6dd08b458532e79c1c"
|
||||
source = "git+https://github.com/mozilla/application-services?branch=desktop-138#52a67ed74c51d23b962de4e002e088bee5e5d24e"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"error-support",
|
||||
@@ -6661,7 +6661,7 @@ checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba"
|
||||
[[package]]
|
||||
name = "types"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/mozilla/application-services?rev=f7947a60b3e9957b97229d6dd08b458532e79c1c#f7947a60b3e9957b97229d6dd08b458532e79c1c"
|
||||
source = "git+https://github.com/mozilla/application-services?branch=desktop-138#52a67ed74c51d23b962de4e002e088bee5e5d24e"
|
||||
dependencies = [
|
||||
"rusqlite",
|
||||
"serde",
|
||||
@@ -7041,7 +7041,7 @@ checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f"
|
||||
[[package]]
|
||||
name = "viaduct"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/mozilla/application-services?rev=f7947a60b3e9957b97229d6dd08b458532e79c1c#f7947a60b3e9957b97229d6dd08b458532e79c1c"
|
||||
source = "git+https://github.com/mozilla/application-services?branch=desktop-138#52a67ed74c51d23b962de4e002e088bee5e5d24e"
|
||||
dependencies = [
|
||||
"ffi-support",
|
||||
"log",
|
||||
@@ -7211,7 +7211,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "webext-storage"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/mozilla/application-services?rev=f7947a60b3e9957b97229d6dd08b458532e79c1c#f7947a60b3e9957b97229d6dd08b458532e79c1c"
|
||||
source = "git+https://github.com/mozilla/application-services?branch=desktop-138#52a67ed74c51d23b962de4e002e088bee5e5d24e"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"error-support",
|
||||
|
||||
18
Cargo.toml
18
Cargo.toml
@@ -235,14 +235,14 @@ malloc_size_of_derive = { path = "xpcom/rust/malloc_size_of_derive" }
|
||||
objc = { git = "https://github.com/glandium/rust-objc", rev = "4de89f5aa9851ceca4d40e7ac1e2759410c04324" }
|
||||
|
||||
# application-services overrides to make updating them all simpler.
|
||||
interrupt-support = { git = "https://github.com/mozilla/application-services", rev = "f7947a60b3e9957b97229d6dd08b458532e79c1c" }
|
||||
relevancy = { git = "https://github.com/mozilla/application-services", rev = "f7947a60b3e9957b97229d6dd08b458532e79c1c" }
|
||||
search = { git = "https://github.com/mozilla/application-services", rev = "f7947a60b3e9957b97229d6dd08b458532e79c1c" }
|
||||
sql-support = { git = "https://github.com/mozilla/application-services", rev = "f7947a60b3e9957b97229d6dd08b458532e79c1c" }
|
||||
suggest = { git = "https://github.com/mozilla/application-services", rev = "f7947a60b3e9957b97229d6dd08b458532e79c1c" }
|
||||
sync15 = { git = "https://github.com/mozilla/application-services", rev = "f7947a60b3e9957b97229d6dd08b458532e79c1c" }
|
||||
tabs = { git = "https://github.com/mozilla/application-services", rev = "f7947a60b3e9957b97229d6dd08b458532e79c1c" }
|
||||
viaduct = { git = "https://github.com/mozilla/application-services", rev = "f7947a60b3e9957b97229d6dd08b458532e79c1c" }
|
||||
webext-storage = { git = "https://github.com/mozilla/application-services", rev = "f7947a60b3e9957b97229d6dd08b458532e79c1c" }
|
||||
interrupt-support = { git = "https://github.com/mozilla/application-services", branch = "desktop-138" }
|
||||
relevancy = { git = "https://github.com/mozilla/application-services", branch = "desktop-138" }
|
||||
search = { git = "https://github.com/mozilla/application-services", branch = "desktop-138" }
|
||||
sql-support = { git = "https://github.com/mozilla/application-services", branch = "desktop-138" }
|
||||
suggest = { git = "https://github.com/mozilla/application-services", branch = "desktop-138" }
|
||||
sync15 = { git = "https://github.com/mozilla/application-services", branch = "desktop-138" }
|
||||
tabs = { git = "https://github.com/mozilla/application-services", branch = "desktop-138" }
|
||||
viaduct = { git = "https://github.com/mozilla/application-services", branch = "desktop-138" }
|
||||
webext-storage = { git = "https://github.com/mozilla/application-services", branch = "desktop-138" }
|
||||
|
||||
allocator-api2 = { path = "third_party/rust/allocator-api2" }
|
||||
|
||||
@@ -946,14 +946,14 @@ suggest:
|
||||
time_unit: microsecond
|
||||
labels:
|
||||
- icon
|
||||
- data
|
||||
- amp
|
||||
- wikipedia
|
||||
- amo-suggestions
|
||||
- pocket-suggestions
|
||||
- yelp-suggestions
|
||||
- mdn-suggestions
|
||||
- weather
|
||||
- configuration
|
||||
- amp-mobile-suggestions
|
||||
- fakespot-suggestions
|
||||
bugs:
|
||||
- https://bugzilla.mozilla.org/show_bug.cgi?id=1908397
|
||||
@@ -972,14 +972,14 @@ suggest:
|
||||
time_unit: microsecond
|
||||
labels:
|
||||
- icon
|
||||
- data
|
||||
- amp
|
||||
- wikipedia
|
||||
- amo-suggestions
|
||||
- pocket-suggestions
|
||||
- yelp-suggestions
|
||||
- mdn-suggestions
|
||||
- weather
|
||||
- configuration
|
||||
- amp-mobile-suggestions
|
||||
- fakespot-suggestions
|
||||
bugs:
|
||||
- https://bugzilla.mozilla.org/show_bug.cgi?id=1908397
|
||||
@@ -998,7 +998,6 @@ suggest:
|
||||
time_unit: microsecond
|
||||
labels:
|
||||
- amp
|
||||
- ampmobile
|
||||
- wikipedia
|
||||
- amo
|
||||
- pocket
|
||||
|
||||
@@ -13,7 +13,10 @@ ChromeUtils.defineESModuleGetters(lazy, {
|
||||
InterruptKind: "resource://gre/modules/RustSuggest.sys.mjs",
|
||||
ObjectUtils: "resource://gre/modules/ObjectUtils.sys.mjs",
|
||||
QuickSuggest: "resource:///modules/QuickSuggest.sys.mjs",
|
||||
RemoteSettingsServer: "resource://gre/modules/RustSuggest.sys.mjs",
|
||||
RemoteSettingsConfig2: "resource://gre/modules/RustRemoteSettings.sys.mjs",
|
||||
RemoteSettingsContext: "resource://gre/modules/RustRemoteSettings.sys.mjs",
|
||||
RemoteSettingsServer: "resource://gre/modules/RustRemoteSettings.sys.mjs",
|
||||
RemoteSettingsService: "resource://gre/modules/RustRemoteSettings.sys.mjs",
|
||||
SuggestIngestionConstraints: "resource://gre/modules/RustSuggest.sys.mjs",
|
||||
SuggestStoreBuilder: "resource://gre/modules/RustSuggest.sys.mjs",
|
||||
Suggestion: "resource://gre/modules/RustSuggest.sys.mjs",
|
||||
@@ -328,6 +331,13 @@ export class SuggestBackendRust extends SuggestBackend {
|
||||
this.#ingestAll();
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {string}
|
||||
* The path of `suggest.sqlite`, where the Rust component stores ingested
|
||||
* suggestions. It also stores dismissed suggestions, which is why we keep
|
||||
* this file in the profile directory, but desktop doesn't currently use the
|
||||
* Rust component for that.
|
||||
*/
|
||||
get #storeDataPath() {
|
||||
return PathUtils.join(
|
||||
Services.dirsvc.get("ProfD", Ci.nsIFile).path,
|
||||
@@ -335,6 +345,15 @@ export class SuggestBackendRust extends SuggestBackend {
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {string}
|
||||
* The path of the directory that should contain the remote settings cache
|
||||
* used internally by the Rust component.
|
||||
*/
|
||||
get #remoteSettingsStoragePath() {
|
||||
return Services.dirsvc.get("ProfLD", Ci.nsIFile).path;
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {Array}
|
||||
* Each item in this array identifies an enabled Rust suggestion type and
|
||||
@@ -361,25 +380,8 @@ export class SuggestBackendRust extends SuggestBackend {
|
||||
}
|
||||
|
||||
#init() {
|
||||
// If the RS config hasn't been set, bail. `this.#store` will remain null,
|
||||
// effectively disabling Rust suggestions.
|
||||
if (!this.#remoteSettingsServer) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Initialize the store.
|
||||
this.logger.info("Initializing SuggestStore", {
|
||||
path: this.#storeDataPath,
|
||||
});
|
||||
let builder = lazy.SuggestStoreBuilder.init()
|
||||
.dataPath(this.#storeDataPath)
|
||||
.loadExtension(AppConstants.SQLITE_LIBRARY_FILENAME, "sqlite3_fts5_init")
|
||||
.remoteSettingsServer(this.#remoteSettingsServer)
|
||||
.remoteSettingsBucketName(this.#remoteSettingsBucketName);
|
||||
try {
|
||||
this.#store = builder.build();
|
||||
} catch (error) {
|
||||
this.logger.error("Error initializing SuggestStore", error);
|
||||
this.#store = this.#makeStore();
|
||||
if (!this.#store) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -390,12 +392,21 @@ export class SuggestBackendRust extends SuggestBackend {
|
||||
);
|
||||
this.logger.debug("Last ingest time (seconds)", lastIngestSecs);
|
||||
|
||||
// Interrupt any ongoing ingests (WRITE) and queries (READ) on shutdown.
|
||||
// Note that `interrupt()` runs on the main thread and is not async; see
|
||||
// toolkit/components/uniffi-bindgen-gecko-js/config.toml
|
||||
this.#shutdownBlocker = () =>
|
||||
// Add our shutdown blocker.
|
||||
this.#shutdownBlocker = () => {
|
||||
// Interrupt any ongoing ingests (WRITE) and queries (READ).
|
||||
// `interrupt()` runs on the main thread and is not async; see
|
||||
// toolkit/components/uniffi-bindgen-gecko-js/config.toml
|
||||
this.#store?.interrupt(lazy.InterruptKind.READ_WRITE);
|
||||
lazy.AsyncShutdown.profileBeforeChange.addBlocker(
|
||||
|
||||
// Null the store so it's destroyed now instead of later when `this` is
|
||||
// collected. The store's Sqlite DBs are synced when dropped (its DB and
|
||||
// its RS client's DB), which causes a `LateWriteObserver` test failure if
|
||||
// it happens too late during shutdown.
|
||||
this.#store = null;
|
||||
this.#shutdownBlocker = null;
|
||||
};
|
||||
lazy.AsyncShutdown.profileChangeTeardown.addBlocker(
|
||||
"QuickSuggest: Interrupt the Rust component",
|
||||
this.#shutdownBlocker
|
||||
);
|
||||
@@ -414,13 +425,73 @@ export class SuggestBackendRust extends SuggestBackend {
|
||||
this.#ingestAll();
|
||||
}
|
||||
|
||||
#makeStore() {
|
||||
this.logger.info("Creating SuggestStore", {
|
||||
server: this.#remoteSettingsServer,
|
||||
bucketName: this.#remoteSettingsBucketName,
|
||||
dataPath: this.#storeDataPath,
|
||||
storagePath: this.#remoteSettingsStoragePath,
|
||||
});
|
||||
|
||||
if (!this.#remoteSettingsServer) {
|
||||
return null;
|
||||
}
|
||||
|
||||
let rsService;
|
||||
try {
|
||||
rsService = lazy.RemoteSettingsService.init(
|
||||
this.#remoteSettingsStoragePath,
|
||||
new lazy.RemoteSettingsConfig2({
|
||||
server: this.#remoteSettingsServer,
|
||||
bucketName: this.#remoteSettingsBucketName,
|
||||
appContext: new lazy.RemoteSettingsContext({
|
||||
appName: Services.appinfo.name || "",
|
||||
appId: Services.appinfo.ID || "",
|
||||
channel: AppConstants.IS_ESR
|
||||
? "esr"
|
||||
: AppConstants.MOZ_UPDATE_CHANNEL,
|
||||
}),
|
||||
})
|
||||
);
|
||||
} catch (error) {
|
||||
this.logger.error("Error creating RemoteSettingsService", error);
|
||||
return null;
|
||||
}
|
||||
|
||||
let builder;
|
||||
try {
|
||||
builder = lazy.SuggestStoreBuilder.init()
|
||||
.dataPath(this.#storeDataPath)
|
||||
.remoteSettingsService(rsService)
|
||||
.loadExtension(
|
||||
AppConstants.SQLITE_LIBRARY_FILENAME,
|
||||
"sqlite3_fts5_init"
|
||||
);
|
||||
} catch (error) {
|
||||
this.logger.error("Error creating SuggestStoreBuilder", error);
|
||||
return null;
|
||||
}
|
||||
|
||||
let store;
|
||||
try {
|
||||
store = builder.build();
|
||||
} catch (error) {
|
||||
this.logger.error("Error creating SuggestStore", error);
|
||||
return null;
|
||||
}
|
||||
|
||||
return store;
|
||||
}
|
||||
|
||||
#uninit() {
|
||||
this.#store = null;
|
||||
this.#providerConstraintsByIngestedSuggestionType.clear();
|
||||
this.#configsBySuggestionType.clear();
|
||||
lazy.timerManager.unregisterTimer(INGEST_TIMER_ID);
|
||||
|
||||
lazy.AsyncShutdown.profileBeforeChange.removeBlocker(this.#shutdownBlocker);
|
||||
lazy.AsyncShutdown.profileChangeTeardown.removeBlocker(
|
||||
this.#shutdownBlocker
|
||||
);
|
||||
this.#shutdownBlocker = null;
|
||||
}
|
||||
|
||||
|
||||
@@ -33,7 +33,10 @@ add_setup(async function test_setup() {
|
||||
],
|
||||
},
|
||||
{
|
||||
type: "data",
|
||||
// eslint-disable-next-line mozilla/valid-lazy
|
||||
collection: lazy.QuickSuggestTestUtils.RS_COLLECTION.AMP,
|
||||
// eslint-disable-next-line mozilla/valid-lazy
|
||||
type: lazy.QuickSuggestTestUtils.RS_TYPE.AMP,
|
||||
// eslint-disable-next-line mozilla/valid-lazy
|
||||
attachment: [lazy.QuickSuggestTestUtils.ampRemoteSettings()],
|
||||
},
|
||||
|
||||
@@ -98,11 +98,18 @@ async function ensureQuickSuggestInit({ ...args } = {}) {
|
||||
return lazy.QuickSuggestTestUtils.ensureQuickSuggestInit({
|
||||
remoteSettingsRecords: [
|
||||
{
|
||||
type: "data",
|
||||
collection: lazy.QuickSuggestTestUtils.RS_COLLECTION.AMP,
|
||||
type: lazy.QuickSuggestTestUtils.RS_TYPE.AMP,
|
||||
attachment: [
|
||||
lazy.QuickSuggestTestUtils.ampRemoteSettings({
|
||||
keywords: ["amp", "amp and wikipedia"],
|
||||
}),
|
||||
],
|
||||
},
|
||||
{
|
||||
collection: lazy.QuickSuggestTestUtils.RS_COLLECTION.OTHER,
|
||||
type: lazy.QuickSuggestTestUtils.RS_TYPE.WIKIPEDIA,
|
||||
attachment: [
|
||||
lazy.QuickSuggestTestUtils.wikipediaRemoteSettings({
|
||||
keywords: ["wikipedia", "amp and wikipedia"],
|
||||
}),
|
||||
|
||||
@@ -130,6 +130,20 @@ class _QuickSuggestTestUtils {
|
||||
}
|
||||
}
|
||||
|
||||
get RS_COLLECTION() {
|
||||
return {
|
||||
AMP: "quicksuggest-amp",
|
||||
OTHER: "quicksuggest-other",
|
||||
};
|
||||
}
|
||||
|
||||
get RS_TYPE() {
|
||||
return {
|
||||
AMP: "amp",
|
||||
WIKIPEDIA: "wikipedia",
|
||||
};
|
||||
}
|
||||
|
||||
get DEFAULT_CONFIG() {
|
||||
// Return a clone so callers can modify it.
|
||||
return Cu.cloneInto(DEFAULT_CONFIG, this);
|
||||
@@ -148,7 +162,7 @@ class _QuickSuggestTestUtils {
|
||||
* - `record.attachment` - Optional. This should be the attachment itself
|
||||
* and not its metadata. It should be a JSONable object.
|
||||
* - `record.collection` - Optional. The name of the RS collection that
|
||||
* the record should be added to. Defaults to "quicksuggest".
|
||||
* the record should be added to. Defaults to "quicksuggest-other".
|
||||
* @param {Array} options.merinoSuggestions
|
||||
* Array of Merino suggestion objects. If given, this function will start
|
||||
* the mock Merino server and set `quicksuggest.dataCollection.enabled` to
|
||||
@@ -189,19 +203,6 @@ class _QuickSuggestTestUtils {
|
||||
this.#log("ensureQuickSuggestInit", "Awaiting ExperimentAPI.ready");
|
||||
await lazy.ExperimentAPI.ready();
|
||||
|
||||
// Make a Map from collection name to the array of records that should be
|
||||
// added to that collection.
|
||||
let recordsByCollection = remoteSettingsRecords.reduce((memo, record) => {
|
||||
let collection = record.collection || "quicksuggest";
|
||||
let records = memo.get(collection);
|
||||
if (!records) {
|
||||
records = [];
|
||||
memo.set(collection, records);
|
||||
}
|
||||
records.push(record);
|
||||
return memo;
|
||||
}, new Map());
|
||||
|
||||
// Set up the local remote settings server.
|
||||
this.#log("ensureQuickSuggestInit", "Preparing remote settings server");
|
||||
if (!this.#remoteSettingsServer) {
|
||||
@@ -209,11 +210,13 @@ class _QuickSuggestTestUtils {
|
||||
}
|
||||
|
||||
this.#remoteSettingsServer.removeRecords();
|
||||
for (let [collection, records] of recordsByCollection.entries()) {
|
||||
for (let [collection, records] of this.#recordsByCollection(
|
||||
remoteSettingsRecords
|
||||
)) {
|
||||
await this.#remoteSettingsServer.addRecords({ collection, records });
|
||||
}
|
||||
await this.#remoteSettingsServer.addRecords({
|
||||
collection: "quicksuggest",
|
||||
collection: this.RS_COLLECTION.OTHER,
|
||||
records: [{ type: "configuration", configuration: config }],
|
||||
});
|
||||
|
||||
@@ -299,10 +302,15 @@ class _QuickSuggestTestUtils {
|
||||
*/
|
||||
async setRemoteSettingsRecords(records, { forceSync = true } = {}) {
|
||||
this.#log("setRemoteSettingsRecords", "Started");
|
||||
await this.#remoteSettingsServer.setRecords({
|
||||
collection: "quicksuggest",
|
||||
records,
|
||||
});
|
||||
|
||||
this.#remoteSettingsServer.removeRecords();
|
||||
for (let [collection, recs] of this.#recordsByCollection(records)) {
|
||||
await this.#remoteSettingsServer.addRecords({
|
||||
collection,
|
||||
records: recs,
|
||||
});
|
||||
}
|
||||
|
||||
if (forceSync) {
|
||||
this.#log("setRemoteSettingsRecords", "Forcing sync");
|
||||
await this.forceSync();
|
||||
@@ -324,7 +332,7 @@ class _QuickSuggestTestUtils {
|
||||
let type = "configuration";
|
||||
this.#remoteSettingsServer.removeRecords({ type });
|
||||
await this.#remoteSettingsServer.addRecords({
|
||||
collection: "quicksuggest",
|
||||
collection: this.RS_COLLECTION.OTHER,
|
||||
records: [{ type, configuration: config }],
|
||||
});
|
||||
this.#log("setConfig", "Forcing sync");
|
||||
@@ -1308,6 +1316,33 @@ class _QuickSuggestTestUtils {
|
||||
this.info?.(`QuickSuggestTestUtils.${fnName} ${msg}`);
|
||||
}
|
||||
|
||||
#recordsByCollection(records) {
|
||||
// Make a Map from collection name to the array of records that should be
|
||||
// added to that collection.
|
||||
let recordsByCollection = records.reduce((memo, record) => {
|
||||
let collection = record.collection || this.RS_COLLECTION.OTHER;
|
||||
let recs = memo.get(collection);
|
||||
if (!recs) {
|
||||
recs = [];
|
||||
memo.set(collection, recs);
|
||||
}
|
||||
recs.push(record);
|
||||
return memo;
|
||||
}, new Map());
|
||||
|
||||
// Make sure the two main collections, "quicksuggest-amp" and
|
||||
// "quicksuggest-other", are present. Otherwise the Rust component will log
|
||||
// 404 errors because it expects them to exist. The errors are harmless but
|
||||
// annoying.
|
||||
for (let collection of Object.values(this.RS_COLLECTION)) {
|
||||
if (!recordsByCollection.has(collection)) {
|
||||
recordsByCollection.set(collection, []);
|
||||
}
|
||||
}
|
||||
|
||||
return recordsByCollection;
|
||||
}
|
||||
|
||||
#remoteSettingsServer;
|
||||
}
|
||||
|
||||
|
||||
@@ -315,7 +315,13 @@ export class RemoteSettingsServer {
|
||||
? lazy.HTTP_404
|
||||
: {
|
||||
body: {
|
||||
metadata: null,
|
||||
metadata: {
|
||||
bucket,
|
||||
signature: {
|
||||
signature: "",
|
||||
x5u: "",
|
||||
},
|
||||
},
|
||||
timestamp: this.#lastModified,
|
||||
changes: records,
|
||||
},
|
||||
|
||||
@@ -41,11 +41,18 @@ add_setup(async function () {
|
||||
await PlacesUtils.bookmarks.eraseEverything();
|
||||
await UrlbarTestUtils.formHistory.clear();
|
||||
|
||||
let isAmp = suggestion => suggestion.iab_category == "22 - Shopping";
|
||||
await QuickSuggestTestUtils.ensureQuickSuggestInit({
|
||||
remoteSettingsRecords: [
|
||||
{
|
||||
type: "data",
|
||||
attachment: REMOTE_SETTINGS_RESULTS,
|
||||
collection: QuickSuggestTestUtils.RS_COLLECTION.AMP,
|
||||
type: QuickSuggestTestUtils.RS_TYPE.AMP,
|
||||
attachment: REMOTE_SETTINGS_RESULTS.filter(isAmp),
|
||||
},
|
||||
{
|
||||
collection: QuickSuggestTestUtils.RS_COLLECTION.OTHER,
|
||||
type: QuickSuggestTestUtils.RS_TYPE.WIKIPEDIA,
|
||||
attachment: REMOTE_SETTINGS_RESULTS.filter(s => !isAmp(s)),
|
||||
},
|
||||
],
|
||||
merinoSuggestions: [],
|
||||
|
||||
@@ -50,11 +50,18 @@ add_setup(async function () {
|
||||
await QuickSuggest.blockedSuggestions._test_readyPromise;
|
||||
await QuickSuggest.blockedSuggestions.clear();
|
||||
|
||||
let isAmp = suggestion => suggestion.iab_category == "22 - Shopping";
|
||||
await QuickSuggestTestUtils.ensureQuickSuggestInit({
|
||||
remoteSettingsRecords: [
|
||||
{
|
||||
type: "data",
|
||||
attachment: REMOTE_SETTINGS_RESULTS,
|
||||
collection: QuickSuggestTestUtils.RS_COLLECTION.AMP,
|
||||
type: QuickSuggestTestUtils.RS_TYPE.AMP,
|
||||
attachment: REMOTE_SETTINGS_RESULTS.filter(isAmp),
|
||||
},
|
||||
{
|
||||
collection: QuickSuggestTestUtils.RS_COLLECTION.OTHER,
|
||||
type: QuickSuggestTestUtils.RS_TYPE.WIKIPEDIA,
|
||||
attachment: REMOTE_SETTINGS_RESULTS.filter(s => !isAmp(s)),
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
@@ -42,11 +42,18 @@ add_setup(async function () {
|
||||
// suggestions so the suggested index of sponsored suggestions should be -1.
|
||||
await SearchTestUtils.installSearchExtension({}, { setAsDefault: true });
|
||||
|
||||
let isAmp = suggestion => suggestion.iab_category == "22 - Shopping";
|
||||
await QuickSuggestTestUtils.ensureQuickSuggestInit({
|
||||
remoteSettingsRecords: [
|
||||
{
|
||||
type: "data",
|
||||
attachment: REMOTE_SETTINGS_RESULTS,
|
||||
collection: QuickSuggestTestUtils.RS_COLLECTION.AMP,
|
||||
type: QuickSuggestTestUtils.RS_TYPE.AMP,
|
||||
attachment: REMOTE_SETTINGS_RESULTS.filter(isAmp),
|
||||
},
|
||||
{
|
||||
collection: QuickSuggestTestUtils.RS_COLLECTION.OTHER,
|
||||
type: QuickSuggestTestUtils.RS_TYPE.WIKIPEDIA,
|
||||
attachment: REMOTE_SETTINGS_RESULTS.filter(s => !isAmp(s)),
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
@@ -17,7 +17,8 @@ add_setup(async function () {
|
||||
await initQuickSuggestPingTest({
|
||||
remoteSettingsRecords: [
|
||||
{
|
||||
type: "data",
|
||||
collection: QuickSuggestTestUtils.RS_COLLECTION.AMP,
|
||||
type: QuickSuggestTestUtils.RS_TYPE.AMP,
|
||||
attachment: [SUGGESTION],
|
||||
},
|
||||
],
|
||||
|
||||
@@ -5,7 +5,8 @@ const lazy = {};
|
||||
|
||||
const EXPECTED_INGEST_LABELS = [
|
||||
// Remote settings `type` field values for the default providers
|
||||
"data",
|
||||
QuickSuggestTestUtils.RS_TYPE.AMP,
|
||||
QuickSuggestTestUtils.RS_TYPE.WIKIPEDIA,
|
||||
"amo-suggestions",
|
||||
"yelp-suggestions",
|
||||
"mdn-suggestions",
|
||||
@@ -24,7 +25,8 @@ const EXPECTED_QUERY_LABELS = [
|
||||
|
||||
const REMOTE_SETTINGS_RECORDS = [
|
||||
{
|
||||
type: "data",
|
||||
collection: QuickSuggestTestUtils.RS_COLLECTION.AMP,
|
||||
type: QuickSuggestTestUtils.RS_TYPE.AMP,
|
||||
attachment: [QuickSuggestTestUtils.ampRemoteSettings()],
|
||||
},
|
||||
];
|
||||
@@ -108,7 +110,8 @@ add_task(async function ingest_changed() {
|
||||
|
||||
await QuickSuggestTestUtils.setRemoteSettingsRecords([
|
||||
{
|
||||
type: "data",
|
||||
collection: QuickSuggestTestUtils.RS_COLLECTION.AMP,
|
||||
type: QuickSuggestTestUtils.RS_TYPE.AMP,
|
||||
attachment: [
|
||||
QuickSuggestTestUtils.ampRemoteSettings({
|
||||
keywords: ["a new keyword"],
|
||||
@@ -131,18 +134,20 @@ add_task(async function ingest_changed() {
|
||||
);
|
||||
checkLabeledTimingDistributionMetricIncreased(
|
||||
"suggest.ingestTime",
|
||||
"data",
|
||||
QuickSuggestTestUtils.RS_TYPE.AMP,
|
||||
oldIngestTimeValues,
|
||||
newIngestTimeValues
|
||||
);
|
||||
checkLabeledTimingDistributionMetricIncreased(
|
||||
"suggest.ingestDownloadTime",
|
||||
"data",
|
||||
QuickSuggestTestUtils.RS_TYPE.AMP,
|
||||
oldIngestDownloadTimeValues,
|
||||
newIngestDownloadTimeValues
|
||||
);
|
||||
|
||||
for (let label of EXPECTED_INGEST_LABELS.filter(l => l != "data")) {
|
||||
for (let label of EXPECTED_INGEST_LABELS.filter(
|
||||
l => l != QuickSuggestTestUtils.RS_TYPE.AMP
|
||||
)) {
|
||||
checkLabeledTimingDistributionMetricUnchanged(
|
||||
"suggest.ingestTime",
|
||||
label,
|
||||
|
||||
@@ -168,22 +168,8 @@ add_setup(async function init() {
|
||||
|
||||
UrlbarPrefs.set("scotchBonnet.enableOverride", false);
|
||||
|
||||
const testDataTypeResults = [
|
||||
Object.assign({}, REMOTE_SETTINGS_RESULTS[0], { title: "test-data-type" }),
|
||||
];
|
||||
|
||||
await QuickSuggestTestUtils.ensureQuickSuggestInit({
|
||||
remoteSettingsRecords: [
|
||||
{
|
||||
type: "data",
|
||||
attachment: REMOTE_SETTINGS_RESULTS,
|
||||
},
|
||||
{
|
||||
type: "test-data-type",
|
||||
attachment: testDataTypeResults,
|
||||
},
|
||||
],
|
||||
});
|
||||
await QuickSuggestTestUtils.ensureQuickSuggestInit();
|
||||
await resetRemoteSettingsData();
|
||||
});
|
||||
|
||||
add_task(async function telemetryType_sponsored() {
|
||||
@@ -1438,12 +1424,7 @@ async function doSponsoredPriorityTest({
|
||||
quickSuggestSponsoredPriority: true,
|
||||
});
|
||||
|
||||
await QuickSuggestTestUtils.setRemoteSettingsRecords([
|
||||
{
|
||||
type: "data",
|
||||
attachment: remoteSettingsData,
|
||||
},
|
||||
]);
|
||||
await resetRemoteSettingsData(remoteSettingsData);
|
||||
await QuickSuggestTestUtils.setConfig(remoteSettingsConfig);
|
||||
|
||||
await check_results({
|
||||
@@ -1455,12 +1436,7 @@ async function doSponsoredPriorityTest({
|
||||
});
|
||||
|
||||
await cleanUpNimbusEnable();
|
||||
await QuickSuggestTestUtils.setRemoteSettingsRecords([
|
||||
{
|
||||
type: "data",
|
||||
attachment: REMOTE_SETTINGS_RESULTS,
|
||||
},
|
||||
]);
|
||||
await resetRemoteSettingsData();
|
||||
await QuickSuggestTestUtils.setConfig(QuickSuggestTestUtils.DEFAULT_CONFIG);
|
||||
}
|
||||
|
||||
@@ -1913,3 +1889,19 @@ async function doAmpMatchingStrategyTest({
|
||||
|
||||
sandbox.restore();
|
||||
}
|
||||
|
||||
async function resetRemoteSettingsData(data = REMOTE_SETTINGS_RESULTS) {
|
||||
let isAmp = suggestion => suggestion.iab_category == "22 - Shopping";
|
||||
await QuickSuggestTestUtils.setRemoteSettingsRecords([
|
||||
{
|
||||
collection: QuickSuggestTestUtils.RS_COLLECTION.AMP,
|
||||
type: QuickSuggestTestUtils.RS_TYPE.AMP,
|
||||
attachment: data.filter(isAmp),
|
||||
},
|
||||
{
|
||||
collection: QuickSuggestTestUtils.RS_COLLECTION.OTHER,
|
||||
type: QuickSuggestTestUtils.RS_TYPE.WIKIPEDIA,
|
||||
attachment: data.filter(s => !isAmp(s)),
|
||||
},
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ const REMOTE_SETTINGS_RECORDS = [
|
||||
},
|
||||
},
|
||||
{
|
||||
type: "data",
|
||||
type: QuickSuggestTestUtils.RS_TYPE.WIKIPEDIA,
|
||||
attachment: [QuickSuggestTestUtils.wikipediaRemoteSettings()],
|
||||
},
|
||||
];
|
||||
@@ -31,7 +31,11 @@ add_setup(async function () {
|
||||
// Add many exposure and AMP suggestions that have the "maxresults" keyword.
|
||||
let maxResults = UrlbarPrefs.get("maxRichResults");
|
||||
Assert.greater(maxResults, 0, "This test expects maxRichResults to be > 0");
|
||||
let ampRecord = { type: "data", attachment: [] };
|
||||
let ampRecord = {
|
||||
collection: QuickSuggestTestUtils.RS_COLLECTION.AMP,
|
||||
type: QuickSuggestTestUtils.RS_TYPE.AMP,
|
||||
attachment: [],
|
||||
};
|
||||
REMOTE_SETTINGS_RECORDS.push(ampRecord);
|
||||
for (let i = 0; i < maxResults; i++) {
|
||||
ampRecord.attachment.push(
|
||||
|
||||
@@ -24,11 +24,13 @@ const REMOTE_SETTINGS_RECORDS = [
|
||||
},
|
||||
},
|
||||
{
|
||||
type: "data",
|
||||
attachment: [
|
||||
QuickSuggestTestUtils.ampRemoteSettings(),
|
||||
QuickSuggestTestUtils.wikipediaRemoteSettings(),
|
||||
],
|
||||
collection: QuickSuggestTestUtils.RS_COLLECTION.AMP,
|
||||
type: QuickSuggestTestUtils.RS_TYPE.AMP,
|
||||
attachment: [QuickSuggestTestUtils.ampRemoteSettings()],
|
||||
},
|
||||
{
|
||||
type: QuickSuggestTestUtils.RS_TYPE.WIKIPEDIA,
|
||||
attachment: [QuickSuggestTestUtils.wikipediaRemoteSettings()],
|
||||
},
|
||||
];
|
||||
|
||||
|
||||
@@ -39,17 +39,12 @@ add_setup(async () => {
|
||||
|
||||
// Set up the remote settings client with the test data.
|
||||
await QuickSuggestTestUtils.ensureQuickSuggestInit({
|
||||
remoteSettingsRecords: [
|
||||
{
|
||||
type: "data",
|
||||
attachment: REMOTE_SETTINGS_RESULTS,
|
||||
},
|
||||
],
|
||||
prefs: [
|
||||
["suggest.quicksuggest.nonsponsored", true],
|
||||
["suggest.quicksuggest.sponsored", true],
|
||||
],
|
||||
});
|
||||
await resetRemoteSettingsData();
|
||||
|
||||
Assert.equal(
|
||||
typeof DEFAULT_SUGGESTION_SCORE,
|
||||
@@ -81,12 +76,7 @@ add_task(async function merinoDisabled() {
|
||||
|
||||
UrlbarPrefs.set("merino.endpointURL", mockEndpointUrl);
|
||||
|
||||
await QuickSuggestTestUtils.setRemoteSettingsRecords([
|
||||
{
|
||||
type: "data",
|
||||
attachment: REMOTE_SETTINGS_RESULTS,
|
||||
},
|
||||
]);
|
||||
await resetRemoteSettingsData();
|
||||
});
|
||||
|
||||
// Tests with Merino enabled but with data collection disabled. Results should
|
||||
@@ -108,12 +98,7 @@ add_task(async function dataCollectionDisabled() {
|
||||
matches: [],
|
||||
});
|
||||
|
||||
await QuickSuggestTestUtils.setRemoteSettingsRecords([
|
||||
{
|
||||
type: "data",
|
||||
attachment: REMOTE_SETTINGS_RESULTS,
|
||||
},
|
||||
]);
|
||||
await resetRemoteSettingsData();
|
||||
});
|
||||
|
||||
// When the Merino suggestion has a higher score than the remote settings
|
||||
@@ -551,3 +536,13 @@ async function doUnmanagedTest({ pref, suggestion }) {
|
||||
function merinoClient() {
|
||||
return QuickSuggest.getFeature("SuggestBackendMerino")?.client;
|
||||
}
|
||||
|
||||
async function resetRemoteSettingsData() {
|
||||
await QuickSuggestTestUtils.setRemoteSettingsRecords([
|
||||
{
|
||||
collection: QuickSuggestTestUtils.RS_COLLECTION.AMP,
|
||||
type: QuickSuggestTestUtils.RS_TYPE.AMP,
|
||||
attachment: REMOTE_SETTINGS_RESULTS,
|
||||
},
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -25,7 +25,8 @@ const { DEFAULT_SUGGESTION_SCORE } = UrlbarProviderQuickSuggest;
|
||||
|
||||
const REMOTE_SETTINGS_RECORDS = [
|
||||
{
|
||||
type: "data",
|
||||
collection: QuickSuggestTestUtils.RS_COLLECTION.AMP,
|
||||
type: QuickSuggestTestUtils.RS_TYPE.AMP,
|
||||
attachment: [
|
||||
// sponsored without score
|
||||
QuickSuggestTestUtils.ampRemoteSettings({
|
||||
@@ -51,6 +52,12 @@ const REMOTE_SETTINGS_RECORDS = [
|
||||
url: "https://example.com/sponsored-with-score",
|
||||
title: "Sponsored with score",
|
||||
}),
|
||||
],
|
||||
},
|
||||
{
|
||||
collection: QuickSuggestTestUtils.RS_COLLECTION.OTHER,
|
||||
type: QuickSuggestTestUtils.RS_TYPE.WIKIPEDIA,
|
||||
attachment: [
|
||||
// nonsponsored without score
|
||||
QuickSuggestTestUtils.wikipediaRemoteSettings({
|
||||
score: undefined,
|
||||
@@ -95,10 +102,11 @@ const REMOTE_SETTINGS_RECORDS = [
|
||||
const ADM_RECORD = REMOTE_SETTINGS_RECORDS[0];
|
||||
const SPONSORED_WITHOUT_SCORE = ADM_RECORD.attachment[0];
|
||||
const SPONSORED_WITH_SCORE = ADM_RECORD.attachment[1];
|
||||
const NONSPONSORED_WITHOUT_SCORE = ADM_RECORD.attachment[2];
|
||||
const NONSPONSORED_WITH_SCORE = ADM_RECORD.attachment[3];
|
||||
const WIKIPEDIA_RECORD = REMOTE_SETTINGS_RECORDS[1];
|
||||
const NONSPONSORED_WITHOUT_SCORE = WIKIPEDIA_RECORD.attachment[0];
|
||||
const NONSPONSORED_WITH_SCORE = WIKIPEDIA_RECORD.attachment[1];
|
||||
|
||||
const ADDON_RECORD = REMOTE_SETTINGS_RECORDS[1];
|
||||
const ADDON_RECORD = REMOTE_SETTINGS_RECORDS[2];
|
||||
const ADDON_WITH_SCORE = ADDON_RECORD.attachment[0];
|
||||
|
||||
const MERINO_SPONSORED_SUGGESTION = {
|
||||
|
||||
@@ -232,7 +232,7 @@ add_task(async function shutdown() {
|
||||
let spy = sandbox.spy(QuickSuggest.rustBackend._test_store, "interrupt");
|
||||
|
||||
Services.prefs.setBoolPref("toolkit.asyncshutdown.testing", true);
|
||||
AsyncShutdown.profileBeforeChange._trigger();
|
||||
AsyncShutdown.profileChangeTeardown._trigger();
|
||||
|
||||
let calls = spy.getCalls();
|
||||
Assert.equal(
|
||||
|
||||
@@ -10,21 +10,26 @@ ChromeUtils.defineESModuleGetters(this, {
|
||||
"resource:///modules/UrlbarProviderQuickSuggest.sys.mjs",
|
||||
});
|
||||
|
||||
const REMOTE_SETTINGS_RESULTS = [
|
||||
QuickSuggestTestUtils.ampRemoteSettings({
|
||||
keywords: ["amp", "amp and wikipedia"],
|
||||
}),
|
||||
QuickSuggestTestUtils.wikipediaRemoteSettings({
|
||||
keywords: ["wikipedia", "amp and wikipedia"],
|
||||
}),
|
||||
];
|
||||
|
||||
add_setup(async function setup() {
|
||||
await QuickSuggestTestUtils.ensureQuickSuggestInit({
|
||||
remoteSettingsRecords: [
|
||||
{
|
||||
type: "data",
|
||||
attachment: REMOTE_SETTINGS_RESULTS,
|
||||
collection: QuickSuggestTestUtils.RS_COLLECTION.AMP,
|
||||
type: QuickSuggestTestUtils.RS_TYPE.AMP,
|
||||
attachment: [
|
||||
QuickSuggestTestUtils.ampRemoteSettings({
|
||||
keywords: ["amp", "amp and wikipedia"],
|
||||
}),
|
||||
],
|
||||
},
|
||||
{
|
||||
collection: QuickSuggestTestUtils.RS_COLLECTION.OTHER,
|
||||
type: QuickSuggestTestUtils.RS_TYPE.WIKIPEDIA,
|
||||
attachment: [
|
||||
QuickSuggestTestUtils.wikipediaRemoteSettings({
|
||||
keywords: ["wikipedia", "amp and wikipedia"],
|
||||
}),
|
||||
],
|
||||
},
|
||||
],
|
||||
prefs: [
|
||||
|
||||
@@ -1 +1 @@
|
||||
{"files":{"Cargo.toml":"5d106662de7bd8f65f1c50edb46a11f54f38a91e08ccf57521978d42086fb53e","dumps/main/attachments/regions/world":"00b308033d44f61612b962f572765d14a3999586d92fc8b9fff2217a1ae070e8","dumps/main/attachments/regions/world-buffered":"1d3ed6954fac2a5b31302f5d3e8186c5fa08a20239afc0643ca5dfbb4d8a86fc","dumps/main/attachments/regions/world-buffered.meta.json":"914a71376a152036aceccb6877e079fbb9e3373c6219f24f00dd30e901a72cce","dumps/main/attachments/regions/world.meta.json":"2a47d77834997b98e563265d299723e7f7fd64c8c7a5731afc722862333d6fbd","dumps/main/regions.json":"e8990158373f82d3f89fed5089cf29e4177cc85904479128728e05025e9a0c0c","dumps/main/search-config-v2.json":"c33698dd66ed7f9dbbda857cad4f890455189e932e24c0d3b335e3e95b65239f","dumps/main/search-telemetry-v2.json":"140b3d322d6e317d97542725920be9f29c6b1d9c5f224e8c31995dddfec6bf1b","src/cache.rs":"c6179802017b43885136e7d64004890cc13e8c2d4742e04073cf404b578f63db","src/client.rs":"875a0bc5c8b3572ed86cd4b43277a715f95592c3d8ab1dd6528394ab6ad71ec3","src/config.rs":"603c7241483861a8c690464f4b50dd3dc281da7edf8aa522f90f175b85a7fa5f","src/error.rs":"20e40a0229842e12888bc43c4159e078f1d09272a43c51dae87989f76952f93b","src/jexl_filter.rs":"e4a9e29a80b216d777771434aaa6c58f627288e4b59ffa11c83dbd8e37889aa5","src/lib.rs":"fbf4e1f270380af00747294ec77ab6bfb724aa38e83bcb8d33fac3f1107850d5","src/macros.rs":"6b06d0ba42ee95235bfd71bac1a0eed02f60c894775ebee64165648b10e932c4","src/schema.rs":"348e0d5ad1840aaae796b537d21381ef91bd75be262138bfec376d9f88d205b3","src/service.rs":"73da6cecc8c804b8e55d35ea3c71c1dd1e4099ad60532b7b0da153f9cde1eb21","src/signatures.rs":"baa2dae76abd8166158fea4676e67e17c17b65af6968de52768350409dbd7092","src/storage.rs":"5ae489964d82a0305a6b250d92f4c1925cc722e44890c24f681dd97b0258b9f4","uniffi.toml":"bd7cc0e7c1981f53938f429c4f2541ac454ed4160a8a0b4670659e38acd23ee5"},"package":null}
|
||||
{"files":{"Cargo.toml":"5d106662de7bd8f65f1c50edb46a11f54f38a91e08ccf57521978d42086fb53e","dumps/main/attachments/regions/world":"00b308033d44f61612b962f572765d14a3999586d92fc8b9fff2217a1ae070e8","dumps/main/attachments/regions/world-buffered":"1d3ed6954fac2a5b31302f5d3e8186c5fa08a20239afc0643ca5dfbb4d8a86fc","dumps/main/attachments/regions/world-buffered.meta.json":"914a71376a152036aceccb6877e079fbb9e3373c6219f24f00dd30e901a72cce","dumps/main/attachments/regions/world.meta.json":"2a47d77834997b98e563265d299723e7f7fd64c8c7a5731afc722862333d6fbd","dumps/main/regions.json":"e8990158373f82d3f89fed5089cf29e4177cc85904479128728e05025e9a0c0c","dumps/main/search-config-v2.json":"c33698dd66ed7f9dbbda857cad4f890455189e932e24c0d3b335e3e95b65239f","dumps/main/search-telemetry-v2.json":"140b3d322d6e317d97542725920be9f29c6b1d9c5f224e8c31995dddfec6bf1b","src/cache.rs":"c6179802017b43885136e7d64004890cc13e8c2d4742e04073cf404b578f63db","src/client.rs":"875a0bc5c8b3572ed86cd4b43277a715f95592c3d8ab1dd6528394ab6ad71ec3","src/config.rs":"603c7241483861a8c690464f4b50dd3dc281da7edf8aa522f90f175b85a7fa5f","src/error.rs":"20e40a0229842e12888bc43c4159e078f1d09272a43c51dae87989f76952f93b","src/jexl_filter.rs":"e4a9e29a80b216d777771434aaa6c58f627288e4b59ffa11c83dbd8e37889aa5","src/lib.rs":"464157ddf3b906c8f480c73dc3161890c8bc76cc95345c6857fee7a57385dc29","src/macros.rs":"6b06d0ba42ee95235bfd71bac1a0eed02f60c894775ebee64165648b10e932c4","src/schema.rs":"348e0d5ad1840aaae796b537d21381ef91bd75be262138bfec376d9f88d205b3","src/service.rs":"73da6cecc8c804b8e55d35ea3c71c1dd1e4099ad60532b7b0da153f9cde1eb21","src/signatures.rs":"baa2dae76abd8166158fea4676e67e17c17b65af6968de52768350409dbd7092","src/storage.rs":"5ae489964d82a0305a6b250d92f4c1925cc722e44890c24f681dd97b0258b9f4","uniffi.toml":"bd7cc0e7c1981f53938f429c4f2541ac454ed4160a8a0b4670659e38acd23ee5"},"package":null}
|
||||
5
third_party/rust/remote_settings/src/lib.rs
vendored
5
third_party/rust/remote_settings/src/lib.rs
vendored
@@ -198,6 +198,11 @@ impl RemoteSettingsClient {
|
||||
pub fn get_attachment(&self, record: &RemoteSettingsRecord) -> ApiResult<Vec<u8>> {
|
||||
self.internal.get_attachment(record)
|
||||
}
|
||||
|
||||
#[handle_error(Error)]
|
||||
pub fn sync(&self) -> ApiResult<()> {
|
||||
self.internal.sync()
|
||||
}
|
||||
}
|
||||
|
||||
impl RemoteSettingsClient {
|
||||
|
||||
@@ -1 +1 @@
|
||||
{"files":{"Cargo.toml":"b02cecce9453963daaaa3b10cd21ca52741496cc3a67de6a3f8b2a7fe45af044","README.md":"5e28baf874b643d756228bdab345e287bf107d3182dfe6a18aafadcc4b9a3fc9","benches/benchmark_all.rs":"5909dfb1e62793afb1f2bc15b75914527a4d14fce6796307c04a309e45c0598c","metrics.yaml":"0540ab2271aeab7f07335c7ceec12acde942995f9dcb3c29070489aa61899d56","src/benchmarks/README.md":"ccee8dbddba8762d0453fa855bd6984137b224b8c019f3dd8e86a3c303f51d71","src/benchmarks/client.rs":"a777c0b876a481a21f9d5fbb696b42672ed0b4af359f62f047ac8240d3e35853","src/benchmarks/geoname.rs":"00fab05cf9465cf8e22e143cde75a81885411001b240af00efda4071975d0563","src/benchmarks/ingest.rs":"d4bde332287cc4a8d95fd7852d7563537f30c578e218a01d32ea7a3d50af3811","src/benchmarks/mod.rs":"1f21f3d3773f88e42c736eed8f770d09bc3fcee559988dbff79a1b02f250b9c5","src/benchmarks/query.rs":"d54946063e72cf98e7f46d94665c17c66af637774c2bb50cd5798dbe63d74f3c","src/bin/debug_ingestion_sizes.rs":"ce6e810be7b3fc19e826d75b622b82cfab5a1a99397a6d0833c2c4eebff2d364","src/config.rs":"0ca876e845841bb6429862c0904c82265003f53b55aea053fac60aed278586a7","src/db.rs":"0aa826507cceaff99cf5f45040ff0cd8cc5424346f0341f0d3ad27c685f30e74","src/error.rs":"e2ef3ec0e0b2b8ecbb8f2f1717d4cb753af06913b8395d086b7643098ad100a7","src/fakespot.rs":"f501c9fe5296e7c130a9fcb532b861465717652cb5ef688230bc7a3b94df91b1","src/geoname.rs":"811f7b26e547be5557bdefb3867206dd4f30237eaef6b3602bef683db5f44586","src/lib.rs":"67d77bf55498ce57c9e607d34e2bc5820403dda1207e85bf1f1c79d235d862f7","src/metrics.rs":"871f0d834efbbc9e26d61f66fa31f0021dcf41444746cd7c082f93ba9628e399","src/pocket.rs":"1316668840ec9b4ea886223921dc9d3b5a1731d1a5206c0b1089f2a6c45c1b7b","src/provider.rs":"b1ec744b867eb5bb40c7e52750e0ff8cb1b34568583e3a625a8d1740517eed6e","src/query.rs":"dcf3c3ddb72564d61b93a0360da6e6e8cb6e62d75b9a743e4a4cf19fb800af68","src/rs.rs":"1d636fac6fdf332c8d14905766d1a1993b7070e0e9f4ca3e427ce9940d8ace5b","src/schema.rs":"ca93e8bbc2d1d42487177f242838f9a36c03ac387b031c8a9f2c0d21cec245a0","src/store.rs":"f4236f04a53a4f8e5f25d210e83cbdeb84f25696cf9229207320f4f3cf930a46","src/suggestion.rs":"cdfc2a60355dfb15dec3d941f1d8137daa2f2ed08465717460e04075911d182b","src/testing/client.rs":"f8c9bd32d0f4cf364daebe114d580c7e36a83b69c07884d14170969620d9a437","src/testing/data.rs":"d92561f8a95cce108c43e5ed040ef9104bc4f370c01f47fe041c2f2c2a493ee0","src/testing/mod.rs":"4d2781c77ed9ace9d80d6d00c63a06bf28a4156f223616fffe3c07e64a8041db","src/util.rs":"52c6ec405637afa2d1a89f29fbbb7dcc341546b6deb97d326c4490bbf8713cb0","src/weather.rs":"8e8958a5a16f09f7d33efc6036d4ba980a2eea53c2d16bcbb37debebde28ef61","src/yelp.rs":"0b9dfa698d9c3162d47c0103d1799838d444345f9d7f943eedc6bcc98fd8b57d","uniffi.toml":"8205e4679ac26d53e70af0f85c013fd27cda1119f4322aebf5f2b9403d45a611"},"package":null}
|
||||
{"files":{"Cargo.toml":"b02cecce9453963daaaa3b10cd21ca52741496cc3a67de6a3f8b2a7fe45af044","README.md":"5e28baf874b643d756228bdab345e287bf107d3182dfe6a18aafadcc4b9a3fc9","benches/benchmark_all.rs":"5909dfb1e62793afb1f2bc15b75914527a4d14fce6796307c04a309e45c0598c","metrics.yaml":"0540ab2271aeab7f07335c7ceec12acde942995f9dcb3c29070489aa61899d56","src/benchmarks/README.md":"ccee8dbddba8762d0453fa855bd6984137b224b8c019f3dd8e86a3c303f51d71","src/benchmarks/client.rs":"e5897d4e2eda06809fa6dc6db4e780b9ef266f613fb113aa6613b83f7005dd0b","src/benchmarks/geoname.rs":"00fab05cf9465cf8e22e143cde75a81885411001b240af00efda4071975d0563","src/benchmarks/ingest.rs":"1f3b5eca704c51bc8f972e7a3492a518516461e5834f97a5f7d1855a048ab16b","src/benchmarks/mod.rs":"ac8965ca749f2932dc90299b159026c73416afadde1f2e71a2613d7d58d6ac3d","src/benchmarks/query.rs":"d54946063e72cf98e7f46d94665c17c66af637774c2bb50cd5798dbe63d74f3c","src/bin/debug_ingestion_sizes.rs":"ce6e810be7b3fc19e826d75b622b82cfab5a1a99397a6d0833c2c4eebff2d364","src/config.rs":"0ca876e845841bb6429862c0904c82265003f53b55aea053fac60aed278586a7","src/db.rs":"e41cbfb922d3c4123ee014f3bcd17c2819aead424c68b51256377a0c8740ef4c","src/error.rs":"e2ef3ec0e0b2b8ecbb8f2f1717d4cb753af06913b8395d086b7643098ad100a7","src/fakespot.rs":"f501c9fe5296e7c130a9fcb532b861465717652cb5ef688230bc7a3b94df91b1","src/geoname.rs":"77376dbc7d06532a7797a93b863f150317df7f31d9200d375c8ea489ac8bee6f","src/lib.rs":"67d77bf55498ce57c9e607d34e2bc5820403dda1207e85bf1f1c79d235d862f7","src/metrics.rs":"871f0d834efbbc9e26d61f66fa31f0021dcf41444746cd7c082f93ba9628e399","src/pocket.rs":"1316668840ec9b4ea886223921dc9d3b5a1731d1a5206c0b1089f2a6c45c1b7b","src/provider.rs":"eaf893b55473d0f6ce7fbc45a70e5d994b054c1d369453eeb12c3d3cf0c1dc31","src/query.rs":"3556e2c76e3fa20f93fa78173162c79bf11fefba930deaa762fa7c5d85cd6f41","src/rs.rs":"c41facd0bd1706065f29267cbf230cb8baae4b34aae85f487b90fd7620bdc0d2","src/schema.rs":"7d0e176e278cca33a76aa83efcbef882d08c3036bc63b930f4f29fd352aafe72","src/store.rs":"200620f428a70e0fa6ae505be07870335843fe5381f26cd1244cdf9817b17b32","src/suggestion.rs":"7e295a534d6914e6c70cc14e0bc7df953b1b266232c812175c82e1a58d0305f9","src/testing/client.rs":"47a32fd84c733001f11e8bfff94dc8c060b6b0780346dca5ddc7a5f5489c1d85","src/testing/data.rs":"2a25c4ba7997f0bd5d1815666dff31b8db845f6f22f3635e878921695a4e783c","src/testing/mod.rs":"dce5a18cc2e6b951304e613055dd8e6b0d89c90934eee55e424ecfdf92f745a5","src/util.rs":"52c6ec405637afa2d1a89f29fbbb7dcc341546b6deb97d326c4490bbf8713cb0","src/weather.rs":"7cc9167dcdfca49d6ad91eba6fba4d5fd49f45052f25a7fe3ad6749d3e6783fb","src/yelp.rs":"0b9dfa698d9c3162d47c0103d1799838d444345f9d7f943eedc6bcc98fd8b57d","uniffi.toml":"8205e4679ac26d53e70af0f85c013fd27cda1119f4322aebf5f2b9403d45a611"},"package":null}
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
use std::collections::HashMap;
|
||||
|
||||
use crate::{db::SuggestDao, error::Error, rs, Result};
|
||||
use crate::{error::Error, rs, Result};
|
||||
|
||||
/// Remotes settings client for benchmarking
|
||||
///
|
||||
@@ -24,16 +24,25 @@ impl RemoteSettingsBenchmarkClient {
|
||||
remote_settings::RemoteSettings::new(remote_settings::RemoteSettingsConfig {
|
||||
server: None,
|
||||
bucket_name: None,
|
||||
collection_name: "quicksuggest".to_owned(),
|
||||
collection_name: rs::Collection::Amp.name().to_owned(),
|
||||
server_url: None,
|
||||
})?,
|
||||
rs::Collection::Quicksuggest,
|
||||
rs::Collection::Amp,
|
||||
)?;
|
||||
new_benchmark_client.fetch_data_with_client(
|
||||
remote_settings::RemoteSettings::new(remote_settings::RemoteSettingsConfig {
|
||||
server: None,
|
||||
bucket_name: None,
|
||||
collection_name: "fakespot-suggest-products".to_owned(),
|
||||
collection_name: rs::Collection::Other.name().to_owned(),
|
||||
server_url: None,
|
||||
})?,
|
||||
rs::Collection::Other,
|
||||
)?;
|
||||
new_benchmark_client.fetch_data_with_client(
|
||||
remote_settings::RemoteSettings::new(remote_settings::RemoteSettingsConfig {
|
||||
server: None,
|
||||
bucket_name: None,
|
||||
collection_name: rs::Collection::Fakespot.name().to_owned(),
|
||||
server_url: None,
|
||||
})?,
|
||||
rs::Collection::Fakespot,
|
||||
@@ -87,11 +96,7 @@ impl RemoteSettingsBenchmarkClient {
|
||||
}
|
||||
|
||||
impl rs::Client for RemoteSettingsBenchmarkClient {
|
||||
fn get_records(
|
||||
&self,
|
||||
collection: rs::Collection,
|
||||
_db: &mut SuggestDao,
|
||||
) -> Result<Vec<rs::Record>> {
|
||||
fn get_records(&self, collection: rs::Collection) -> Result<Vec<rs::Record>> {
|
||||
Ok(self
|
||||
.records
|
||||
.iter()
|
||||
|
||||
103
third_party/rust/suggest/src/benchmarks/ingest.rs
vendored
103
third_party/rust/suggest/src/benchmarks/ingest.rs
vendored
@@ -6,7 +6,8 @@ use std::sync::OnceLock;
|
||||
|
||||
use crate::{
|
||||
benchmarks::{client::RemoteSettingsBenchmarkClient, unique_db_filename, BenchmarkWithInput},
|
||||
rs::SuggestRecordType,
|
||||
provider::SuggestionProvider,
|
||||
rs::{Collection, SuggestRecordType},
|
||||
store::SuggestStoreInner,
|
||||
SuggestIngestionConstraints,
|
||||
};
|
||||
@@ -14,6 +15,7 @@ use crate::{
|
||||
pub struct IngestBenchmark {
|
||||
temp_dir: tempfile::TempDir,
|
||||
client: RemoteSettingsBenchmarkClient,
|
||||
collection: Collection,
|
||||
record_type: SuggestRecordType,
|
||||
reingest: bool,
|
||||
}
|
||||
@@ -31,11 +33,24 @@ fn get_benchmark_client() -> RemoteSettingsBenchmarkClient {
|
||||
}
|
||||
|
||||
impl IngestBenchmark {
|
||||
pub fn new(record_type: SuggestRecordType, reingest: bool) -> Self {
|
||||
pub fn new(provider: SuggestionProvider, reingest: bool) -> Self {
|
||||
Self::new_with_record_type(
|
||||
provider.primary_collection(),
|
||||
provider.primary_record_type(),
|
||||
reingest,
|
||||
)
|
||||
}
|
||||
|
||||
pub fn new_with_record_type(
|
||||
collection: Collection,
|
||||
record_type: SuggestRecordType,
|
||||
reingest: bool,
|
||||
) -> Self {
|
||||
let temp_dir = tempfile::tempdir().unwrap();
|
||||
Self {
|
||||
client: get_benchmark_client(),
|
||||
temp_dir,
|
||||
collection,
|
||||
record_type,
|
||||
reingest,
|
||||
}
|
||||
@@ -58,7 +73,7 @@ impl BenchmarkWithInput for IngestBenchmark {
|
||||
let store = SuggestStoreInner::new(data_path, vec![], self.client.clone());
|
||||
store.ensure_db_initialized();
|
||||
if self.reingest {
|
||||
store.ingest_records_by_type(self.record_type);
|
||||
store.ingest_records_by_type(self.collection, self.record_type);
|
||||
store.force_reingest();
|
||||
}
|
||||
InputType(store)
|
||||
@@ -66,7 +81,7 @@ impl BenchmarkWithInput for IngestBenchmark {
|
||||
|
||||
fn benchmarked_code(&self, _: &Self::GlobalInput, input: Self::IterationInput) {
|
||||
let InputType(store) = input;
|
||||
store.ingest_records_by_type(self.record_type);
|
||||
store.ingest_records_by_type(self.collection, self.record_type);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,84 +89,104 @@ impl BenchmarkWithInput for IngestBenchmark {
|
||||
pub fn all_benchmarks() -> Vec<(&'static str, IngestBenchmark)> {
|
||||
vec![
|
||||
(
|
||||
"ingest-icon",
|
||||
IngestBenchmark::new(SuggestRecordType::Icon, false),
|
||||
"ingest-icon-amp",
|
||||
IngestBenchmark::new_with_record_type(Collection::Amp, SuggestRecordType::Icon, false),
|
||||
),
|
||||
(
|
||||
"ingest-again-icon",
|
||||
IngestBenchmark::new(SuggestRecordType::Icon, true),
|
||||
"ingest-again-icon-amp",
|
||||
IngestBenchmark::new_with_record_type(Collection::Amp, SuggestRecordType::Icon, true),
|
||||
),
|
||||
(
|
||||
"ingest-amp-wikipedia",
|
||||
IngestBenchmark::new(SuggestRecordType::AmpWikipedia, false),
|
||||
"ingest-icon-other",
|
||||
IngestBenchmark::new_with_record_type(
|
||||
Collection::Other,
|
||||
SuggestRecordType::Icon,
|
||||
false,
|
||||
),
|
||||
),
|
||||
(
|
||||
"ingest-again-amp-wikipedia",
|
||||
IngestBenchmark::new(SuggestRecordType::AmpWikipedia, true),
|
||||
"ingest-again-icon-other",
|
||||
IngestBenchmark::new_with_record_type(Collection::Other, SuggestRecordType::Icon, true),
|
||||
),
|
||||
(
|
||||
"ingest-amp",
|
||||
IngestBenchmark::new(SuggestionProvider::Amp, false),
|
||||
),
|
||||
(
|
||||
"ingest-again-amp",
|
||||
IngestBenchmark::new(SuggestionProvider::Amp, true),
|
||||
),
|
||||
(
|
||||
"ingest-wikipedia",
|
||||
IngestBenchmark::new(SuggestionProvider::Wikipedia, false),
|
||||
),
|
||||
(
|
||||
"ingest-again-wikipedia",
|
||||
IngestBenchmark::new(SuggestionProvider::Wikipedia, true),
|
||||
),
|
||||
(
|
||||
"ingest-amo",
|
||||
IngestBenchmark::new(SuggestRecordType::Amo, false),
|
||||
IngestBenchmark::new(SuggestionProvider::Amo, false),
|
||||
),
|
||||
(
|
||||
"ingest-again-amo",
|
||||
IngestBenchmark::new(SuggestRecordType::Amo, true),
|
||||
IngestBenchmark::new(SuggestionProvider::Amo, true),
|
||||
),
|
||||
(
|
||||
"ingest-pocket",
|
||||
IngestBenchmark::new(SuggestRecordType::Pocket, false),
|
||||
IngestBenchmark::new(SuggestionProvider::Pocket, false),
|
||||
),
|
||||
(
|
||||
"ingest-again-pocket",
|
||||
IngestBenchmark::new(SuggestRecordType::Pocket, true),
|
||||
IngestBenchmark::new(SuggestionProvider::Pocket, true),
|
||||
),
|
||||
(
|
||||
"ingest-yelp",
|
||||
IngestBenchmark::new(SuggestRecordType::Yelp, false),
|
||||
IngestBenchmark::new(SuggestionProvider::Yelp, false),
|
||||
),
|
||||
(
|
||||
"ingest-again-yelp",
|
||||
IngestBenchmark::new(SuggestRecordType::Yelp, true),
|
||||
IngestBenchmark::new(SuggestionProvider::Yelp, true),
|
||||
),
|
||||
(
|
||||
"ingest-mdn",
|
||||
IngestBenchmark::new(SuggestRecordType::Mdn, false),
|
||||
IngestBenchmark::new(SuggestionProvider::Mdn, false),
|
||||
),
|
||||
(
|
||||
"ingest-again-mdn",
|
||||
IngestBenchmark::new(SuggestRecordType::Mdn, true),
|
||||
IngestBenchmark::new(SuggestionProvider::Mdn, true),
|
||||
),
|
||||
(
|
||||
"ingest-weather",
|
||||
IngestBenchmark::new(SuggestRecordType::Weather, false),
|
||||
IngestBenchmark::new(SuggestionProvider::Weather, false),
|
||||
),
|
||||
(
|
||||
"ingest-again-weather",
|
||||
IngestBenchmark::new(SuggestRecordType::Weather, true),
|
||||
IngestBenchmark::new(SuggestionProvider::Weather, true),
|
||||
),
|
||||
(
|
||||
"ingest-global-config",
|
||||
IngestBenchmark::new(SuggestRecordType::GlobalConfig, false),
|
||||
IngestBenchmark::new_with_record_type(
|
||||
Collection::Other,
|
||||
SuggestRecordType::GlobalConfig,
|
||||
false,
|
||||
),
|
||||
),
|
||||
(
|
||||
"ingest-again-global-config",
|
||||
IngestBenchmark::new(SuggestRecordType::GlobalConfig, true),
|
||||
),
|
||||
(
|
||||
"ingest-amp-mobile",
|
||||
IngestBenchmark::new(SuggestRecordType::AmpMobile, false),
|
||||
),
|
||||
(
|
||||
"ingest-again-amp-mobile",
|
||||
IngestBenchmark::new(SuggestRecordType::AmpMobile, true),
|
||||
IngestBenchmark::new_with_record_type(
|
||||
Collection::Other,
|
||||
SuggestRecordType::GlobalConfig,
|
||||
true,
|
||||
),
|
||||
),
|
||||
(
|
||||
"ingest-fakespot",
|
||||
IngestBenchmark::new(SuggestRecordType::Fakespot, false),
|
||||
IngestBenchmark::new(SuggestionProvider::Fakespot, false),
|
||||
),
|
||||
(
|
||||
"ingest-again-fakespot",
|
||||
IngestBenchmark::new(SuggestRecordType::Fakespot, true),
|
||||
IngestBenchmark::new(SuggestionProvider::Fakespot, true),
|
||||
),
|
||||
]
|
||||
}
|
||||
|
||||
24
third_party/rust/suggest/src/benchmarks/mod.rs
vendored
24
third_party/rust/suggest/src/benchmarks/mod.rs
vendored
@@ -20,6 +20,9 @@ use std::{
|
||||
use tempfile::TempDir;
|
||||
|
||||
use crate::{SuggestIngestionConstraints, SuggestStore};
|
||||
use remote_settings::{RemoteSettingsConfig2, RemoteSettingsContext, RemoteSettingsService};
|
||||
|
||||
use std::sync::Arc;
|
||||
|
||||
pub mod client;
|
||||
pub mod geoname;
|
||||
@@ -76,8 +79,15 @@ fn new_store() -> SuggestStore {
|
||||
let (starter_dir, starter_db_path) = starter.get_or_insert_with(|| {
|
||||
let temp_dir = tempfile::tempdir().unwrap();
|
||||
let db_path = temp_dir.path().join(unique_db_filename());
|
||||
let store =
|
||||
SuggestStore::new(&db_path.to_string_lossy(), None).expect("Error building store");
|
||||
let rs_config = RemoteSettingsConfig2 {
|
||||
bucket_name: None,
|
||||
server: None,
|
||||
app_context: Some(RemoteSettingsContext::default()),
|
||||
};
|
||||
let remote_settings_service =
|
||||
Arc::new(RemoteSettingsService::new("".to_string(), rs_config).unwrap());
|
||||
let store = SuggestStore::new(&db_path.to_string_lossy(), remote_settings_service)
|
||||
.expect("Error building store");
|
||||
store
|
||||
.ingest(SuggestIngestionConstraints::all_providers())
|
||||
.expect("Error during ingestion");
|
||||
@@ -86,8 +96,16 @@ fn new_store() -> SuggestStore {
|
||||
});
|
||||
|
||||
let db_path = starter_dir.path().join(unique_db_filename());
|
||||
let rs_config = RemoteSettingsConfig2 {
|
||||
bucket_name: None,
|
||||
server: None,
|
||||
app_context: Some(RemoteSettingsContext::default()),
|
||||
};
|
||||
let remote_settings_service =
|
||||
Arc::new(RemoteSettingsService::new("".to_string(), rs_config).unwrap());
|
||||
std::fs::copy(starter_db_path, &db_path).expect("Error copying starter DB file");
|
||||
SuggestStore::new(&db_path.to_string_lossy(), None).expect("Error building store")
|
||||
SuggestStore::new(&db_path.to_string_lossy(), remote_settings_service)
|
||||
.expect("Error building store")
|
||||
}
|
||||
|
||||
/// Cleanup the temp directory created for SuggestStore instances used in the benchmarks.
|
||||
|
||||
169
third_party/rust/suggest/src/db.rs
vendored
169
third_party/rust/suggest/src/db.rs
vendored
@@ -7,11 +7,10 @@ use std::{cell::OnceCell, path::Path, sync::Arc};
|
||||
|
||||
use interrupt_support::{SqlInterruptHandle, SqlInterruptScope};
|
||||
use parking_lot::{Mutex, MutexGuard};
|
||||
use remote_settings::RemoteSettingsResponse;
|
||||
use rusqlite::{
|
||||
named_params,
|
||||
types::{FromSql, ToSql},
|
||||
Connection, OptionalExtension,
|
||||
Connection,
|
||||
};
|
||||
use sql_support::{open_database, repeat_sql_vars, ConnExt};
|
||||
|
||||
@@ -24,12 +23,12 @@ use crate::{
|
||||
provider::{AmpMatchingStrategy, SuggestionProvider},
|
||||
query::{full_keywords_to_fts_content, FtsQuery},
|
||||
rs::{
|
||||
DownloadedAmoSuggestion, DownloadedAmpSuggestion, DownloadedAmpWikipediaSuggestion,
|
||||
DownloadedExposureSuggestion, DownloadedFakespotSuggestion, DownloadedMdnSuggestion,
|
||||
DownloadedPocketSuggestion, DownloadedWikipediaSuggestion, Record, SuggestRecordId,
|
||||
DownloadedAmoSuggestion, DownloadedAmpSuggestion, DownloadedExposureSuggestion,
|
||||
DownloadedFakespotSuggestion, DownloadedMdnSuggestion, DownloadedPocketSuggestion,
|
||||
DownloadedWikipediaSuggestion, Record, SuggestRecordId,
|
||||
},
|
||||
schema::{clear_database, SuggestConnectionInitializer},
|
||||
suggestion::{cook_raw_suggestion_url, AmpSuggestionType, FtsMatchInfo, Suggestion},
|
||||
suggestion::{cook_raw_suggestion_url, FtsMatchInfo, Suggestion},
|
||||
util::full_keyword,
|
||||
weather::WeatherCache,
|
||||
Result, SuggestionQuery,
|
||||
@@ -202,52 +201,6 @@ impl<'a> SuggestDao<'a> {
|
||||
//
|
||||
// These methods implement CRUD operations
|
||||
|
||||
pub fn read_cached_rs_data(&self, collection: &str) -> Option<RemoteSettingsResponse> {
|
||||
match self.try_read_cached_rs_data(collection) {
|
||||
Ok(result) => result,
|
||||
Err(e) => {
|
||||
// Return None on failure . If the cached data is corrupted, maybe because the
|
||||
// RemoteSettingsResponse schema changed, then we want to just continue on. This also matches
|
||||
// the proposed API from #6328, so it should be easier to adapt this code once
|
||||
// that's merged.
|
||||
error_support::report_error!("suggest-rs-cache-read", "{e}");
|
||||
None
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn write_cached_rs_data(&mut self, collection: &str, data: &RemoteSettingsResponse) {
|
||||
if let Err(e) = self.try_write_cached_rs_data(collection, data) {
|
||||
// Return None on failure for the same reason as in [Self::read_cached_rs_data]
|
||||
error_support::report_error!("suggest-rs-cache-write", "{e}");
|
||||
}
|
||||
}
|
||||
|
||||
fn try_read_cached_rs_data(&self, collection: &str) -> Result<Option<RemoteSettingsResponse>> {
|
||||
let mut stmt = self
|
||||
.conn
|
||||
.prepare_cached("SELECT data FROM rs_cache WHERE collection = ?")?;
|
||||
let data = stmt
|
||||
.query_row((collection,), |row| row.get::<_, Vec<u8>>(0))
|
||||
.optional()?;
|
||||
match data {
|
||||
Some(data) => Ok(Some(rmp_serde::decode::from_slice(data.as_slice())?)),
|
||||
None => Ok(None),
|
||||
}
|
||||
}
|
||||
|
||||
fn try_write_cached_rs_data(
|
||||
&mut self,
|
||||
collection: &str,
|
||||
data: &RemoteSettingsResponse,
|
||||
) -> Result<()> {
|
||||
let mut stmt = self
|
||||
.conn
|
||||
.prepare_cached("INSERT OR REPLACE INTO rs_cache(collection, data) VALUES(?, ?)")?;
|
||||
stmt.execute((collection, rmp_serde::encode::to_vec(data)?))?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn get_ingested_records(&self) -> Result<Vec<IngestedRecord>> {
|
||||
let mut stmt = self
|
||||
.conn
|
||||
@@ -302,25 +255,21 @@ impl<'a> SuggestDao<'a> {
|
||||
}
|
||||
|
||||
/// Fetches Suggestions of type Amp provider that match the given query
|
||||
pub fn fetch_amp_suggestions(
|
||||
&self,
|
||||
query: &SuggestionQuery,
|
||||
suggestion_type: AmpSuggestionType,
|
||||
) -> Result<Vec<Suggestion>> {
|
||||
pub fn fetch_amp_suggestions(&self, query: &SuggestionQuery) -> Result<Vec<Suggestion>> {
|
||||
let strategy = query
|
||||
.provider_constraints
|
||||
.as_ref()
|
||||
.and_then(|c| c.amp_alternative_matching.as_ref());
|
||||
match strategy {
|
||||
None => self.fetch_amp_suggestions_using_keywords(query, suggestion_type, true),
|
||||
None => self.fetch_amp_suggestions_using_keywords(query, true),
|
||||
Some(AmpMatchingStrategy::NoKeywordExpansion) => {
|
||||
self.fetch_amp_suggestions_using_keywords(query, suggestion_type, false)
|
||||
self.fetch_amp_suggestions_using_keywords(query, false)
|
||||
}
|
||||
Some(AmpMatchingStrategy::FtsAgainstFullKeywords) => {
|
||||
self.fetch_amp_suggestions_using_fts(query, suggestion_type, "full_keywords")
|
||||
self.fetch_amp_suggestions_using_fts(query, "full_keywords")
|
||||
}
|
||||
Some(AmpMatchingStrategy::FtsAgainstTitle) => {
|
||||
self.fetch_amp_suggestions_using_fts(query, suggestion_type, "title")
|
||||
self.fetch_amp_suggestions_using_fts(query, "title")
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -328,14 +277,9 @@ impl<'a> SuggestDao<'a> {
|
||||
pub fn fetch_amp_suggestions_using_keywords(
|
||||
&self,
|
||||
query: &SuggestionQuery,
|
||||
suggestion_type: AmpSuggestionType,
|
||||
allow_keyword_expansion: bool,
|
||||
) -> Result<Vec<Suggestion>> {
|
||||
let keyword_lowercased = &query.keyword.to_lowercase();
|
||||
let provider = match suggestion_type {
|
||||
AmpSuggestionType::Mobile => SuggestionProvider::AmpMobile,
|
||||
AmpSuggestionType::Desktop => SuggestionProvider::Amp,
|
||||
};
|
||||
let where_extra = if allow_keyword_expansion {
|
||||
""
|
||||
} else {
|
||||
@@ -369,7 +313,7 @@ impl<'a> SuggestDao<'a> {
|
||||
),
|
||||
named_params! {
|
||||
":keyword": keyword_lowercased,
|
||||
":provider": provider
|
||||
":provider": SuggestionProvider::Amp,
|
||||
},
|
||||
|row| -> Result<Suggestion> {
|
||||
let suggestion_id: i64 = row.get("id")?;
|
||||
@@ -448,15 +392,10 @@ impl<'a> SuggestDao<'a> {
|
||||
pub fn fetch_amp_suggestions_using_fts(
|
||||
&self,
|
||||
query: &SuggestionQuery,
|
||||
suggestion_type: AmpSuggestionType,
|
||||
fts_column: &str,
|
||||
) -> Result<Vec<Suggestion>> {
|
||||
let fts_query = query.fts_query();
|
||||
let match_arg = &fts_query.match_arg;
|
||||
let provider = match suggestion_type {
|
||||
AmpSuggestionType::Mobile => SuggestionProvider::AmpMobile,
|
||||
AmpSuggestionType::Desktop => SuggestionProvider::Amp,
|
||||
};
|
||||
let suggestions = self.conn.query_rows_and_then_cached(
|
||||
&format!(
|
||||
r#"
|
||||
@@ -480,7 +419,7 @@ impl<'a> SuggestDao<'a> {
|
||||
"#
|
||||
),
|
||||
named_params! {
|
||||
":provider": provider
|
||||
":provider": SuggestionProvider::Amp,
|
||||
},
|
||||
|row| -> Result<Suggestion> {
|
||||
let suggestion_id: i64 = row.get("id")?;
|
||||
@@ -1114,59 +1053,43 @@ impl<'a> SuggestDao<'a> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Inserts all suggestions from a downloaded AMP-Wikipedia attachment into
|
||||
/// the database.
|
||||
pub fn insert_amp_wikipedia_suggestions(
|
||||
/// Inserts suggestions from an AMP attachment into the database.
|
||||
pub fn insert_amp_suggestions(
|
||||
&mut self,
|
||||
record_id: &SuggestRecordId,
|
||||
suggestions: &[DownloadedAmpWikipediaSuggestion],
|
||||
suggestions: &[DownloadedAmpSuggestion],
|
||||
enable_fts: bool,
|
||||
) -> Result<()> {
|
||||
// Prepare statements outside of the loop. This results in a large performance
|
||||
// improvement on a fresh ingest, since there are so many rows.
|
||||
let mut suggestion_insert = SuggestionInsertStatement::new(self.conn)?;
|
||||
let mut amp_insert = AmpInsertStatement::new(self.conn)?;
|
||||
let mut wiki_insert = WikipediaInsertStatement::new(self.conn)?;
|
||||
let mut keyword_insert = KeywordInsertStatement::new(self.conn)?;
|
||||
let mut fts_insert = AmpFtsInsertStatement::new(self.conn)?;
|
||||
for suggestion in suggestions {
|
||||
self.scope.err_if_interrupted()?;
|
||||
let common_details = suggestion.common_details();
|
||||
let provider = suggestion.provider();
|
||||
|
||||
let suggestion_id = suggestion_insert.execute(
|
||||
record_id,
|
||||
&common_details.title,
|
||||
&common_details.url,
|
||||
common_details.score.unwrap_or(DEFAULT_SUGGESTION_SCORE),
|
||||
provider,
|
||||
&suggestion.title,
|
||||
&suggestion.url,
|
||||
suggestion.score.unwrap_or(DEFAULT_SUGGESTION_SCORE),
|
||||
SuggestionProvider::Amp,
|
||||
)?;
|
||||
match suggestion {
|
||||
DownloadedAmpWikipediaSuggestion::Amp(amp) => {
|
||||
amp_insert.execute(suggestion_id, amp)?;
|
||||
}
|
||||
DownloadedAmpWikipediaSuggestion::Wikipedia(wikipedia) => {
|
||||
wiki_insert.execute(suggestion_id, wikipedia)?;
|
||||
}
|
||||
}
|
||||
amp_insert.execute(suggestion_id, suggestion)?;
|
||||
if enable_fts {
|
||||
fts_insert.execute(
|
||||
suggestion_id,
|
||||
&common_details.full_keywords_fts_column(),
|
||||
&common_details.title,
|
||||
&suggestion.full_keywords_fts_column(),
|
||||
&suggestion.title,
|
||||
)?;
|
||||
}
|
||||
let mut full_keyword_inserter = FullKeywordInserter::new(self.conn, suggestion_id);
|
||||
for keyword in common_details.keywords() {
|
||||
let full_keyword_id = match (suggestion, keyword.full_keyword) {
|
||||
// Try to associate full keyword data. Only do this for AMP, we decided to
|
||||
// skip it for Wikipedia in https://bugzilla.mozilla.org/show_bug.cgi?id=1876217
|
||||
(DownloadedAmpWikipediaSuggestion::Amp(_), Some(full_keyword)) => {
|
||||
Some(full_keyword_inserter.maybe_insert(full_keyword)?)
|
||||
}
|
||||
_ => None,
|
||||
for keyword in suggestion.keywords() {
|
||||
let full_keyword_id = if let Some(full_keyword) = keyword.full_keyword {
|
||||
Some(full_keyword_inserter.maybe_insert(full_keyword)?)
|
||||
} else {
|
||||
None
|
||||
};
|
||||
|
||||
keyword_insert.execute(
|
||||
suggestion_id,
|
||||
keyword.keyword,
|
||||
@@ -1178,40 +1101,30 @@ impl<'a> SuggestDao<'a> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Inserts all suggestions from a downloaded AMP-Mobile attachment into
|
||||
/// the database.
|
||||
pub fn insert_amp_mobile_suggestions(
|
||||
/// Inserts suggestions from a Wikipedia attachment into the database.
|
||||
pub fn insert_wikipedia_suggestions(
|
||||
&mut self,
|
||||
record_id: &SuggestRecordId,
|
||||
suggestions: &[DownloadedAmpSuggestion],
|
||||
suggestions: &[DownloadedWikipediaSuggestion],
|
||||
) -> Result<()> {
|
||||
// Prepare statements outside of the loop. This results in a large performance
|
||||
// improvement on a fresh ingest, since there are so many rows.
|
||||
let mut suggestion_insert = SuggestionInsertStatement::new(self.conn)?;
|
||||
let mut amp_insert = AmpInsertStatement::new(self.conn)?;
|
||||
let mut wiki_insert = WikipediaInsertStatement::new(self.conn)?;
|
||||
let mut keyword_insert = KeywordInsertStatement::new(self.conn)?;
|
||||
for suggestion in suggestions {
|
||||
self.scope.err_if_interrupted()?;
|
||||
let common_details = &suggestion.common_details;
|
||||
let suggestion_id = suggestion_insert.execute(
|
||||
record_id,
|
||||
&common_details.title,
|
||||
&common_details.url,
|
||||
common_details.score.unwrap_or(DEFAULT_SUGGESTION_SCORE),
|
||||
SuggestionProvider::AmpMobile,
|
||||
&suggestion.title,
|
||||
&suggestion.url,
|
||||
suggestion.score.unwrap_or(DEFAULT_SUGGESTION_SCORE),
|
||||
SuggestionProvider::Wikipedia,
|
||||
)?;
|
||||
amp_insert.execute(suggestion_id, suggestion)?;
|
||||
|
||||
let mut full_keyword_inserter = FullKeywordInserter::new(self.conn, suggestion_id);
|
||||
for keyword in common_details.keywords() {
|
||||
let full_keyword_id = keyword
|
||||
.full_keyword
|
||||
.map(|full_keyword| full_keyword_inserter.maybe_insert(full_keyword))
|
||||
.transpose()?;
|
||||
keyword_insert.execute(
|
||||
suggestion_id,
|
||||
keyword.keyword,
|
||||
full_keyword_id,
|
||||
keyword.rank,
|
||||
)?;
|
||||
wiki_insert.execute(suggestion_id, suggestion)?;
|
||||
for keyword in suggestion.keywords() {
|
||||
// Don't update `full_keywords`, see bug 1876217.
|
||||
keyword_insert.execute(suggestion_id, keyword.keyword, None, keyword.rank)?;
|
||||
}
|
||||
}
|
||||
Ok(())
|
||||
|
||||
511
third_party/rust/suggest/src/geoname.rs
vendored
511
third_party/rust/suggest/src/geoname.rs
vendored
@@ -396,7 +396,7 @@ struct GeonameInsertStatement<'conn>(rusqlite::Statement<'conn>);
|
||||
impl<'conn> GeonameInsertStatement<'conn> {
|
||||
fn new(conn: &'conn Connection) -> Result<Self> {
|
||||
Ok(Self(conn.prepare(
|
||||
"INSERT INTO geonames(
|
||||
"INSERT OR REPLACE INTO geonames(
|
||||
id,
|
||||
record_id,
|
||||
name,
|
||||
@@ -437,7 +437,7 @@ struct GeonameAlternateInsertStatement<'conn>(rusqlite::Statement<'conn>);
|
||||
impl<'conn> GeonameAlternateInsertStatement<'conn> {
|
||||
fn new(conn: &'conn Connection) -> Result<Self> {
|
||||
Ok(Self(conn.prepare(
|
||||
"INSERT INTO geonames_alternates(
|
||||
"INSERT OR REPLACE INTO geonames_alternates(
|
||||
name,
|
||||
geoname_id,
|
||||
iso_language
|
||||
@@ -460,7 +460,7 @@ struct GeonameMetricsInsertStatement<'conn>(rusqlite::Statement<'conn>);
|
||||
impl<'conn> GeonameMetricsInsertStatement<'conn> {
|
||||
pub(crate) fn new(conn: &'conn Connection) -> Result<Self> {
|
||||
Ok(Self(conn.prepare(
|
||||
"INSERT INTO geonames_metrics(
|
||||
"INSERT OR REPLACE INTO geonames_metrics(
|
||||
record_id,
|
||||
max_name_length,
|
||||
max_name_word_count
|
||||
@@ -487,204 +487,221 @@ impl<'conn> GeonameMetricsInsertStatement<'conn> {
|
||||
pub(crate) mod tests {
|
||||
use super::*;
|
||||
use crate::{
|
||||
provider::SuggestionProvider, store::tests::TestStore, testing::*,
|
||||
provider::SuggestionProvider,
|
||||
rs::{Collection, SuggestRecordType},
|
||||
store::tests::TestStore,
|
||||
testing::*,
|
||||
SuggestIngestionConstraints,
|
||||
};
|
||||
use serde_json::Value as JsonValue;
|
||||
|
||||
pub(crate) const LONG_NAME: &str = "aaa bbb ccc ddd eee fff ggg hhh iii jjj kkk lll mmm nnn ooo ppp qqq rrr sss ttt uuu vvv www x yyy zzz";
|
||||
|
||||
pub(crate) fn geoname_mock_record(id: &str, json: JsonValue) -> MockRecord {
|
||||
MockRecord {
|
||||
collection: Collection::Other,
|
||||
record_type: SuggestRecordType::Geonames,
|
||||
id: id.to_string(),
|
||||
inline_data: None,
|
||||
attachment: Some(MockAttachment::Json(json)),
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn new_test_store() -> TestStore {
|
||||
TestStore::new(MockRemoteSettingsClient::default().with_record(
|
||||
"geonames",
|
||||
"geonames-0",
|
||||
json!({
|
||||
"max_alternate_name_length": LONG_NAME.len(),
|
||||
"max_alternate_name_word_count": LONG_NAME.split_whitespace().collect::<Vec<_>>().len(),
|
||||
"geonames": [
|
||||
// Waterloo, AL
|
||||
{
|
||||
"id": 1,
|
||||
"name": "Waterloo",
|
||||
"latitude": "34.91814",
|
||||
"longitude": "-88.0642",
|
||||
"feature_class": "P",
|
||||
"feature_code": "PPL",
|
||||
"country_code": "US",
|
||||
"admin1_code": "AL",
|
||||
"population": 200,
|
||||
"alternate_names": ["waterloo"],
|
||||
"alternate_names_2": [
|
||||
{ "name": "waterloo" },
|
||||
],
|
||||
},
|
||||
// AL
|
||||
{
|
||||
"id": 2,
|
||||
"name": "Alabama",
|
||||
"latitude": "32.75041",
|
||||
"longitude": "-86.75026",
|
||||
"feature_class": "A",
|
||||
"feature_code": "ADM1",
|
||||
"country_code": "US",
|
||||
"admin1_code": "AL",
|
||||
"population": 4530315,
|
||||
"alternate_names": ["al", "alabama"],
|
||||
"alternate_names_2": [
|
||||
{ "name": "alabama" },
|
||||
{ "name": "al", "iso_language": "abbr" },
|
||||
],
|
||||
},
|
||||
// Waterloo, IA
|
||||
{
|
||||
"id": 3,
|
||||
"name": "Waterloo",
|
||||
"latitude": "42.49276",
|
||||
"longitude": "-92.34296",
|
||||
"feature_class": "P",
|
||||
"feature_code": "PPLA2",
|
||||
"country_code": "US",
|
||||
"admin1_code": "IA",
|
||||
"population": 68460,
|
||||
"alternate_names": ["waterloo"],
|
||||
"alternate_names_2": [
|
||||
{ "name": "waterloo" },
|
||||
],
|
||||
},
|
||||
// IA
|
||||
{
|
||||
"id": 4,
|
||||
"name": "Iowa",
|
||||
"latitude": "42.00027",
|
||||
"longitude": "-93.50049",
|
||||
"feature_class": "A",
|
||||
"feature_code": "ADM1",
|
||||
"country_code": "US",
|
||||
"admin1_code": "IA",
|
||||
"population": 2955010,
|
||||
"alternate_names": ["ia", "iowa"],
|
||||
"alternate_names_2": [
|
||||
{ "name": "iowa" },
|
||||
{ "name": "ia", "iso_language": "abbr" },
|
||||
],
|
||||
},
|
||||
// Waterloo (Lake, not a city or region)
|
||||
{
|
||||
"id": 5,
|
||||
"name": "waterloo lake",
|
||||
"latitude": "31.25044",
|
||||
"longitude": "-99.25061",
|
||||
"feature_class": "H",
|
||||
"feature_code": "LK",
|
||||
"country_code": "US",
|
||||
"admin1_code": "TX",
|
||||
"population": 0,
|
||||
"alternate_names_2": [
|
||||
{ "name": "waterloo lake" },
|
||||
{ "name": "waterloo", "iso_language": "en" },
|
||||
],
|
||||
},
|
||||
// New York City
|
||||
{
|
||||
"id": 6,
|
||||
"name": "New York City",
|
||||
"latitude": "40.71427",
|
||||
"longitude": "-74.00597",
|
||||
"feature_class": "P",
|
||||
"feature_code": "PPL",
|
||||
"country_code": "US",
|
||||
"admin1_code": "NY",
|
||||
"population": 8804190,
|
||||
"alternate_names_2": [
|
||||
{ "name": "new york city" },
|
||||
{ "name": "new york", "iso_language": "en" },
|
||||
{ "name": "nyc", "iso_language": "abbr" },
|
||||
{ "name": "ny", "iso_language": "abbr" },
|
||||
],
|
||||
},
|
||||
// Rochester, NY
|
||||
{
|
||||
"id": 7,
|
||||
"name": "Rochester",
|
||||
"latitude": "43.15478",
|
||||
"longitude": "-77.61556",
|
||||
"feature_class": "P",
|
||||
"feature_code": "PPLA2",
|
||||
"country_code": "US",
|
||||
"admin1_code": "NY",
|
||||
"population": 209802,
|
||||
"alternate_names_2": [
|
||||
{ "name": "rochester" },
|
||||
{ "name": "roc", "iso_language": "iata" },
|
||||
],
|
||||
},
|
||||
// NY state
|
||||
{
|
||||
"id": 8,
|
||||
"name": "New York",
|
||||
"latitude": "43.00035",
|
||||
"longitude": "-75.4999",
|
||||
"feature_class": "A",
|
||||
"feature_code": "ADM1",
|
||||
"country_code": "US",
|
||||
"admin1_code": "NY",
|
||||
"population": 19274244,
|
||||
"alternate_names_2": [
|
||||
{ "name": "new york" },
|
||||
{ "name": "ny", "iso_language": "abbr" },
|
||||
],
|
||||
},
|
||||
// Waco, TX: Has a surprising IATA airport code that's a
|
||||
// common English word and not a prefix of the city name
|
||||
{
|
||||
"id": 9,
|
||||
"name": "Waco",
|
||||
"latitude": "31.54933",
|
||||
"longitude": "-97.14667",
|
||||
"feature_class": "P",
|
||||
"feature_code": "PPLA2",
|
||||
"country_code": "US",
|
||||
"admin1_code": "TX",
|
||||
"population": 132356,
|
||||
"alternate_names_2": [
|
||||
{ "name": "waco" },
|
||||
{ "name": "act", "iso_language": "iata" },
|
||||
],
|
||||
},
|
||||
// TX
|
||||
{
|
||||
"id": 10,
|
||||
"name": "Texas",
|
||||
"latitude": "31.25044",
|
||||
"longitude": "-99.25061",
|
||||
"feature_class": "A",
|
||||
"feature_code": "ADM1",
|
||||
"country_code": "US",
|
||||
"admin1_code": "TX",
|
||||
"population": 22875689,
|
||||
"alternate_names_2": [
|
||||
{ "name": "texas" },
|
||||
{ "name": "tx", "iso_language": "abbr" },
|
||||
],
|
||||
},
|
||||
// Made-up city with a long name
|
||||
{
|
||||
"id": 999,
|
||||
"name": "Long Name",
|
||||
"latitude": "38.06084",
|
||||
"longitude": "-97.92977",
|
||||
"feature_class": "P",
|
||||
"feature_code": "PPLA2",
|
||||
"country_code": "US",
|
||||
"admin1_code": "NY",
|
||||
"population": 2,
|
||||
"alternate_names_2": [
|
||||
{ "name": "long name" },
|
||||
{ "name": LONG_NAME, "iso_language": "en" },
|
||||
],
|
||||
},
|
||||
],
|
||||
}),
|
||||
))
|
||||
TestStore::new(
|
||||
MockRemoteSettingsClient::default()
|
||||
.with_record(geoname_mock_record("geonames-0", geonames_data())),
|
||||
)
|
||||
}
|
||||
|
||||
fn geonames_data() -> serde_json::Value {
|
||||
json!({
|
||||
"max_alternate_name_length": LONG_NAME.len(),
|
||||
"max_alternate_name_word_count": LONG_NAME.split_whitespace().collect::<Vec<_>>().len(),
|
||||
"geonames": [
|
||||
// Waterloo, AL
|
||||
{
|
||||
"id": 1,
|
||||
"name": "Waterloo",
|
||||
"latitude": "34.91814",
|
||||
"longitude": "-88.0642",
|
||||
"feature_class": "P",
|
||||
"feature_code": "PPL",
|
||||
"country_code": "US",
|
||||
"admin1_code": "AL",
|
||||
"population": 200,
|
||||
"alternate_names": ["waterloo"],
|
||||
"alternate_names_2": [
|
||||
{ "name": "waterloo" },
|
||||
],
|
||||
},
|
||||
// AL
|
||||
{
|
||||
"id": 2,
|
||||
"name": "Alabama",
|
||||
"latitude": "32.75041",
|
||||
"longitude": "-86.75026",
|
||||
"feature_class": "A",
|
||||
"feature_code": "ADM1",
|
||||
"country_code": "US",
|
||||
"admin1_code": "AL",
|
||||
"population": 4530315,
|
||||
"alternate_names": ["al", "alabama"],
|
||||
"alternate_names_2": [
|
||||
{ "name": "alabama" },
|
||||
{ "name": "al", "iso_language": "abbr" },
|
||||
],
|
||||
},
|
||||
// Waterloo, IA
|
||||
{
|
||||
"id": 3,
|
||||
"name": "Waterloo",
|
||||
"latitude": "42.49276",
|
||||
"longitude": "-92.34296",
|
||||
"feature_class": "P",
|
||||
"feature_code": "PPLA2",
|
||||
"country_code": "US",
|
||||
"admin1_code": "IA",
|
||||
"population": 68460,
|
||||
"alternate_names": ["waterloo"],
|
||||
"alternate_names_2": [
|
||||
{ "name": "waterloo" },
|
||||
],
|
||||
},
|
||||
// IA
|
||||
{
|
||||
"id": 4,
|
||||
"name": "Iowa",
|
||||
"latitude": "42.00027",
|
||||
"longitude": "-93.50049",
|
||||
"feature_class": "A",
|
||||
"feature_code": "ADM1",
|
||||
"country_code": "US",
|
||||
"admin1_code": "IA",
|
||||
"population": 2955010,
|
||||
"alternate_names": ["ia", "iowa"],
|
||||
"alternate_names_2": [
|
||||
{ "name": "iowa" },
|
||||
{ "name": "ia", "iso_language": "abbr" },
|
||||
],
|
||||
},
|
||||
// Waterloo (Lake, not a city or region)
|
||||
{
|
||||
"id": 5,
|
||||
"name": "waterloo lake",
|
||||
"latitude": "31.25044",
|
||||
"longitude": "-99.25061",
|
||||
"feature_class": "H",
|
||||
"feature_code": "LK",
|
||||
"country_code": "US",
|
||||
"admin1_code": "TX",
|
||||
"population": 0,
|
||||
"alternate_names_2": [
|
||||
{ "name": "waterloo lake" },
|
||||
{ "name": "waterloo", "iso_language": "en" },
|
||||
],
|
||||
},
|
||||
// New York City
|
||||
{
|
||||
"id": 6,
|
||||
"name": "New York City",
|
||||
"latitude": "40.71427",
|
||||
"longitude": "-74.00597",
|
||||
"feature_class": "P",
|
||||
"feature_code": "PPL",
|
||||
"country_code": "US",
|
||||
"admin1_code": "NY",
|
||||
"population": 8804190,
|
||||
"alternate_names_2": [
|
||||
{ "name": "new york city" },
|
||||
{ "name": "new york", "iso_language": "en" },
|
||||
{ "name": "nyc", "iso_language": "abbr" },
|
||||
{ "name": "ny", "iso_language": "abbr" },
|
||||
],
|
||||
},
|
||||
// Rochester, NY
|
||||
{
|
||||
"id": 7,
|
||||
"name": "Rochester",
|
||||
"latitude": "43.15478",
|
||||
"longitude": "-77.61556",
|
||||
"feature_class": "P",
|
||||
"feature_code": "PPLA2",
|
||||
"country_code": "US",
|
||||
"admin1_code": "NY",
|
||||
"population": 209802,
|
||||
"alternate_names_2": [
|
||||
{ "name": "rochester" },
|
||||
{ "name": "roc", "iso_language": "iata" },
|
||||
],
|
||||
},
|
||||
// NY state
|
||||
{
|
||||
"id": 8,
|
||||
"name": "New York",
|
||||
"latitude": "43.00035",
|
||||
"longitude": "-75.4999",
|
||||
"feature_class": "A",
|
||||
"feature_code": "ADM1",
|
||||
"country_code": "US",
|
||||
"admin1_code": "NY",
|
||||
"population": 19274244,
|
||||
"alternate_names_2": [
|
||||
{ "name": "new york" },
|
||||
{ "name": "ny", "iso_language": "abbr" },
|
||||
],
|
||||
},
|
||||
// Waco, TX: Has a surprising IATA airport code that's a
|
||||
// common English word and not a prefix of the city name
|
||||
{
|
||||
"id": 9,
|
||||
"name": "Waco",
|
||||
"latitude": "31.54933",
|
||||
"longitude": "-97.14667",
|
||||
"feature_class": "P",
|
||||
"feature_code": "PPLA2",
|
||||
"country_code": "US",
|
||||
"admin1_code": "TX",
|
||||
"population": 132356,
|
||||
"alternate_names_2": [
|
||||
{ "name": "waco" },
|
||||
{ "name": "act", "iso_language": "iata" },
|
||||
],
|
||||
},
|
||||
// TX
|
||||
{
|
||||
"id": 10,
|
||||
"name": "Texas",
|
||||
"latitude": "31.25044",
|
||||
"longitude": "-99.25061",
|
||||
"feature_class": "A",
|
||||
"feature_code": "ADM1",
|
||||
"country_code": "US",
|
||||
"admin1_code": "TX",
|
||||
"population": 22875689,
|
||||
"alternate_names_2": [
|
||||
{ "name": "texas" },
|
||||
{ "name": "tx", "iso_language": "abbr" },
|
||||
],
|
||||
},
|
||||
// Made-up city with a long name
|
||||
{
|
||||
"id": 999,
|
||||
"name": "Long Name",
|
||||
"latitude": "38.06084",
|
||||
"longitude": "-97.92977",
|
||||
"feature_class": "P",
|
||||
"feature_code": "PPLA2",
|
||||
"country_code": "US",
|
||||
"admin1_code": "NY",
|
||||
"population": 2,
|
||||
"alternate_names_2": [
|
||||
{ "name": "long name" },
|
||||
{ "name": LONG_NAME, "iso_language": "en" },
|
||||
],
|
||||
},
|
||||
],
|
||||
})
|
||||
}
|
||||
|
||||
pub(crate) fn waterloo_al() -> Geoname {
|
||||
@@ -1288,24 +1305,22 @@ pub(crate) mod tests {
|
||||
// metrics so the other values don't matter.
|
||||
let mut store = TestStore::new(
|
||||
MockRemoteSettingsClient::default()
|
||||
.with_record(
|
||||
"geonames",
|
||||
.with_record(geoname_mock_record(
|
||||
"geonames-0",
|
||||
json!({
|
||||
"max_alternate_name_length": 10,
|
||||
"max_alternate_name_word_count": 5,
|
||||
"geonames": []
|
||||
}),
|
||||
)
|
||||
.with_record(
|
||||
"geonames",
|
||||
))
|
||||
.with_record(geoname_mock_record(
|
||||
"geonames-1",
|
||||
json!({
|
||||
"max_alternate_name_length": 20,
|
||||
"max_alternate_name_word_count": 2,
|
||||
"geonames": []
|
||||
}),
|
||||
),
|
||||
)),
|
||||
);
|
||||
|
||||
// Ingest weather to also ingest geonames.
|
||||
@@ -1324,7 +1339,7 @@ pub(crate) mod tests {
|
||||
// Delete the first record. The metrics should change.
|
||||
store
|
||||
.client_mut()
|
||||
.delete_record("quicksuggest", "geonames-0");
|
||||
.delete_record(geoname_mock_record("geonames-0", json!({})));
|
||||
store.ingest(SuggestIngestionConstraints {
|
||||
providers: Some(vec![SuggestionProvider::Weather]),
|
||||
..SuggestIngestionConstraints::all_providers()
|
||||
@@ -1337,15 +1352,14 @@ pub(crate) mod tests {
|
||||
})?;
|
||||
|
||||
// Add a new record. The metrics should change again.
|
||||
store.client_mut().add_record(
|
||||
"geonames",
|
||||
store.client_mut().add_record(geoname_mock_record(
|
||||
"geonames-3",
|
||||
json!({
|
||||
"max_alternate_name_length": 15,
|
||||
"max_alternate_name_word_count": 3,
|
||||
"geonames": []
|
||||
}),
|
||||
);
|
||||
));
|
||||
store.ingest(SuggestIngestionConstraints {
|
||||
providers: Some(vec![SuggestionProvider::Weather]),
|
||||
..SuggestIngestionConstraints::all_providers()
|
||||
@@ -1394,7 +1408,7 @@ pub(crate) mod tests {
|
||||
// Delete the record.
|
||||
store
|
||||
.client_mut()
|
||||
.delete_record("quicksuggest", "geonames-0");
|
||||
.delete_record(geoname_mock_record("geonames-0", json!({})));
|
||||
store.ingest(SuggestIngestionConstraints {
|
||||
providers: Some(vec![SuggestionProvider::Weather]),
|
||||
..SuggestIngestionConstraints::all_providers()
|
||||
@@ -1425,6 +1439,91 @@ pub(crate) mod tests {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn geonames_reingest() -> anyhow::Result<()> {
|
||||
before_each();
|
||||
|
||||
// Create the store with the test data and ingest.
|
||||
let mut store = new_test_store();
|
||||
store.ingest(SuggestIngestionConstraints {
|
||||
providers: Some(vec![SuggestionProvider::Weather]),
|
||||
..SuggestIngestionConstraints::all_providers()
|
||||
});
|
||||
|
||||
// Get the table counts.
|
||||
let (geonames_count, alternates_count) = store.read(|dao| {
|
||||
Ok((
|
||||
dao.conn.query_row_and_then(
|
||||
"SELECT count(*) FROM geonames",
|
||||
[],
|
||||
|row| -> Result<i64> { Ok(row.get(0)?) },
|
||||
)?,
|
||||
dao.conn.query_row_and_then(
|
||||
"SELECT count(*) FROM geonames_alternates",
|
||||
[],
|
||||
|row| -> Result<i64> { Ok(row.get(0)?) },
|
||||
)?,
|
||||
))
|
||||
})?;
|
||||
|
||||
assert_ne!(geonames_count, 0);
|
||||
assert_ne!(alternates_count, 0);
|
||||
|
||||
// Delete the record and add a new record with a new ID that has the
|
||||
// same data.
|
||||
store
|
||||
.client_mut()
|
||||
.delete_record(geoname_mock_record("geonames-0", json!({})))
|
||||
.add_record(geoname_mock_record("geonames-1", geonames_data()));
|
||||
|
||||
// Ingest again.
|
||||
store.ingest(SuggestIngestionConstraints {
|
||||
providers: Some(vec![SuggestionProvider::Weather]),
|
||||
..SuggestIngestionConstraints::all_providers()
|
||||
});
|
||||
|
||||
// Make sure we have a match.
|
||||
store.read(|dao| {
|
||||
assert_eq!(
|
||||
dao.fetch_geonames("waterloo", false, None, None)?,
|
||||
vec![
|
||||
GeonameMatch {
|
||||
geoname: waterloo_ia(),
|
||||
match_type: GeonameMatchType::Name,
|
||||
prefix: false,
|
||||
},
|
||||
GeonameMatch {
|
||||
geoname: waterloo_al(),
|
||||
match_type: GeonameMatchType::Name,
|
||||
prefix: false,
|
||||
},
|
||||
],
|
||||
);
|
||||
Ok(())
|
||||
})?;
|
||||
|
||||
// Get the table counts again. They should be the same as before.
|
||||
let (new_geonames_count, new_alternates_count) = store.read(|dao| {
|
||||
Ok((
|
||||
dao.conn.query_row_and_then(
|
||||
"SELECT count(*) FROM geonames",
|
||||
[],
|
||||
|row| -> Result<i64> { Ok(row.get(0)?) },
|
||||
)?,
|
||||
dao.conn.query_row_and_then(
|
||||
"SELECT count(*) FROM geonames_alternates",
|
||||
[],
|
||||
|row| -> Result<i64> { Ok(row.get(0)?) },
|
||||
)?,
|
||||
))
|
||||
})?;
|
||||
|
||||
assert_eq!(geonames_count, new_geonames_count);
|
||||
assert_eq!(alternates_count, new_alternates_count);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn geonames_store_api() -> anyhow::Result<()> {
|
||||
before_each();
|
||||
|
||||
136
third_party/rust/suggest/src/provider.rs
vendored
136
third_party/rust/suggest/src/provider.rs
vendored
@@ -3,24 +3,32 @@
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
use std::fmt;
|
||||
use std::{
|
||||
collections::{HashMap, HashSet},
|
||||
fmt,
|
||||
};
|
||||
|
||||
use rusqlite::{
|
||||
types::{FromSql, FromSqlError, FromSqlResult, ToSql, ToSqlOutput, ValueRef},
|
||||
Result as RusqliteResult,
|
||||
};
|
||||
|
||||
use crate::rs::SuggestRecordType;
|
||||
use crate::rs::{Collection, SuggestRecordType};
|
||||
|
||||
#[cfg(test)]
|
||||
use serde_json::Value as JsonValue;
|
||||
|
||||
#[cfg(test)]
|
||||
use crate::testing::{MockAttachment, MockIcon, MockRecord};
|
||||
|
||||
/// Record types from these providers will be ingested when consumers do not
|
||||
/// specify providers in `SuggestIngestionConstraints`.
|
||||
pub(crate) const DEFAULT_INGEST_PROVIDERS: [SuggestionProvider; 6] = [
|
||||
pub(crate) const DEFAULT_INGEST_PROVIDERS: [SuggestionProvider; 5] = [
|
||||
SuggestionProvider::Amp,
|
||||
SuggestionProvider::Wikipedia,
|
||||
SuggestionProvider::Amo,
|
||||
SuggestionProvider::Yelp,
|
||||
SuggestionProvider::Mdn,
|
||||
SuggestionProvider::AmpMobile,
|
||||
];
|
||||
|
||||
/// A provider is a source of search suggestions.
|
||||
@@ -34,9 +42,8 @@ pub enum SuggestionProvider {
|
||||
Yelp = 5,
|
||||
Mdn = 6,
|
||||
Weather = 7,
|
||||
AmpMobile = 8,
|
||||
Fakespot = 9,
|
||||
Exposure = 10,
|
||||
Fakespot = 8,
|
||||
Exposure = 9,
|
||||
}
|
||||
|
||||
impl fmt::Display for SuggestionProvider {
|
||||
@@ -49,7 +56,6 @@ impl fmt::Display for SuggestionProvider {
|
||||
Self::Yelp => write!(f, "yelp"),
|
||||
Self::Mdn => write!(f, "mdn"),
|
||||
Self::Weather => write!(f, "weather"),
|
||||
Self::AmpMobile => write!(f, "ampmobile"),
|
||||
Self::Fakespot => write!(f, "fakespot"),
|
||||
Self::Exposure => write!(f, "exposure"),
|
||||
}
|
||||
@@ -67,7 +73,7 @@ impl FromSql for SuggestionProvider {
|
||||
}
|
||||
|
||||
impl SuggestionProvider {
|
||||
pub fn all() -> [Self; 10] {
|
||||
pub fn all() -> [Self; 9] {
|
||||
[
|
||||
Self::Amp,
|
||||
Self::Wikipedia,
|
||||
@@ -76,7 +82,6 @@ impl SuggestionProvider {
|
||||
Self::Yelp,
|
||||
Self::Mdn,
|
||||
Self::Weather,
|
||||
Self::AmpMobile,
|
||||
Self::Fakespot,
|
||||
Self::Exposure,
|
||||
]
|
||||
@@ -92,27 +97,74 @@ impl SuggestionProvider {
|
||||
5 => Some(Self::Yelp),
|
||||
6 => Some(Self::Mdn),
|
||||
7 => Some(Self::Weather),
|
||||
8 => Some(Self::AmpMobile),
|
||||
9 => Some(Self::Fakespot),
|
||||
10 => Some(Self::Exposure),
|
||||
8 => Some(Self::Fakespot),
|
||||
9 => Some(Self::Exposure),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn record_types(&self) -> Vec<SuggestRecordType> {
|
||||
/// The collection that stores the provider's primary record.
|
||||
pub(crate) fn primary_collection(&self) -> Collection {
|
||||
match self {
|
||||
Self::Amp => vec![SuggestRecordType::AmpWikipedia],
|
||||
Self::Wikipedia => vec![SuggestRecordType::AmpWikipedia],
|
||||
Self::Amo => vec![SuggestRecordType::Amo],
|
||||
Self::Pocket => vec![SuggestRecordType::Pocket],
|
||||
Self::Yelp => vec![SuggestRecordType::Yelp, SuggestRecordType::Geonames],
|
||||
Self::Mdn => vec![SuggestRecordType::Mdn],
|
||||
Self::Weather => vec![SuggestRecordType::Weather, SuggestRecordType::Geonames],
|
||||
Self::AmpMobile => vec![SuggestRecordType::AmpMobile],
|
||||
Self::Fakespot => vec![SuggestRecordType::Fakespot],
|
||||
Self::Exposure => vec![SuggestRecordType::Exposure],
|
||||
Self::Amp => Collection::Amp,
|
||||
Self::Fakespot => Collection::Fakespot,
|
||||
_ => Collection::Other,
|
||||
}
|
||||
}
|
||||
|
||||
/// The provider's primary record type.
|
||||
pub(crate) fn primary_record_type(&self) -> SuggestRecordType {
|
||||
match self {
|
||||
Self::Amp => SuggestRecordType::Amp,
|
||||
Self::Wikipedia => SuggestRecordType::Wikipedia,
|
||||
Self::Amo => SuggestRecordType::Amo,
|
||||
Self::Pocket => SuggestRecordType::Pocket,
|
||||
Self::Yelp => SuggestRecordType::Yelp,
|
||||
Self::Mdn => SuggestRecordType::Mdn,
|
||||
Self::Weather => SuggestRecordType::Weather,
|
||||
Self::Fakespot => SuggestRecordType::Fakespot,
|
||||
Self::Exposure => SuggestRecordType::Exposure,
|
||||
}
|
||||
}
|
||||
|
||||
/// Other record types and their collections that the provider depends on.
|
||||
fn secondary_record_types(&self) -> Option<HashMap<Collection, HashSet<SuggestRecordType>>> {
|
||||
match self {
|
||||
Self::Amp => Some(HashMap::from([(
|
||||
Collection::Amp,
|
||||
HashSet::from([SuggestRecordType::Icon]),
|
||||
)])),
|
||||
Self::Wikipedia => Some(HashMap::from([(
|
||||
Collection::Other,
|
||||
HashSet::from([SuggestRecordType::Icon]),
|
||||
)])),
|
||||
Self::Yelp => Some(HashMap::from([(
|
||||
Collection::Other,
|
||||
HashSet::from([SuggestRecordType::Icon, SuggestRecordType::Geonames]),
|
||||
)])),
|
||||
Self::Weather => Some(HashMap::from([(
|
||||
Collection::Other,
|
||||
HashSet::from([SuggestRecordType::Geonames]),
|
||||
)])),
|
||||
Self::Fakespot => Some(HashMap::from([(
|
||||
Collection::Fakespot,
|
||||
HashSet::from([SuggestRecordType::Icon]),
|
||||
)])),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
|
||||
/// All record types and their collections that the provider depends on,
|
||||
/// including primary and secondary records.
|
||||
pub(crate) fn record_types_by_collection(
|
||||
&self,
|
||||
) -> HashMap<Collection, HashSet<SuggestRecordType>> {
|
||||
let mut rts = self.secondary_record_types().unwrap_or_default();
|
||||
rts.entry(self.primary_collection())
|
||||
.or_default()
|
||||
.insert(self.primary_record_type());
|
||||
rts
|
||||
}
|
||||
}
|
||||
|
||||
impl ToSql for SuggestionProvider {
|
||||
@@ -121,6 +173,42 @@ impl ToSql for SuggestionProvider {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
impl SuggestionProvider {
|
||||
pub fn record(&self, record_id: &str, attachment: JsonValue) -> MockRecord {
|
||||
self.full_record(record_id, None, Some(MockAttachment::Json(attachment)))
|
||||
}
|
||||
|
||||
pub fn empty_record(&self, record_id: &str) -> MockRecord {
|
||||
self.full_record(record_id, None, None)
|
||||
}
|
||||
|
||||
pub fn full_record(
|
||||
&self,
|
||||
record_id: &str,
|
||||
inline_data: Option<JsonValue>,
|
||||
attachment: Option<MockAttachment>,
|
||||
) -> MockRecord {
|
||||
MockRecord {
|
||||
collection: self.primary_collection(),
|
||||
record_type: self.primary_record_type(),
|
||||
id: record_id.to_string(),
|
||||
inline_data,
|
||||
attachment,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn icon(&self, icon: MockIcon) -> MockRecord {
|
||||
MockRecord {
|
||||
collection: self.primary_collection(),
|
||||
record_type: SuggestRecordType::Icon,
|
||||
id: format!("icon-{}", icon.id),
|
||||
inline_data: None,
|
||||
attachment: Some(MockAttachment::Icon(icon)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// 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)]
|
||||
|
||||
8
third_party/rust/suggest/src/query.rs
vendored
8
third_party/rust/suggest/src/query.rs
vendored
@@ -69,14 +69,6 @@ impl SuggestionQuery {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn amp_mobile(keyword: &str) -> Self {
|
||||
Self {
|
||||
keyword: keyword.into(),
|
||||
providers: vec![SuggestionProvider::AmpMobile],
|
||||
..Self::default()
|
||||
}
|
||||
}
|
||||
|
||||
pub fn amo(keyword: &str) -> Self {
|
||||
Self {
|
||||
keyword: keyword.into(),
|
||||
|
||||
348
third_party/rust/suggest/src/rs.rs
vendored
348
third_party/rust/suggest/src/rs.rs
vendored
@@ -31,27 +31,30 @@
|
||||
//! the new suggestion in their results, and return `Suggestion::T` variants
|
||||
//! as needed.
|
||||
|
||||
use std::fmt;
|
||||
use std::{fmt, sync::Arc};
|
||||
|
||||
use remote_settings::{Attachment, RemoteSettingsRecord};
|
||||
use serde::{Deserialize, Deserializer};
|
||||
|
||||
use crate::{
|
||||
db::SuggestDao, error::Error, provider::SuggestionProvider,
|
||||
query::full_keywords_to_fts_content, Result,
|
||||
use remote_settings::{
|
||||
Attachment, RemoteSettingsClient, RemoteSettingsError, RemoteSettingsRecord,
|
||||
RemoteSettingsService,
|
||||
};
|
||||
use serde::{Deserialize, Deserializer, Serialize};
|
||||
use serde_json::{Map, Value};
|
||||
|
||||
use crate::{error::Error, query::full_keywords_to_fts_content, Result};
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
|
||||
pub enum Collection {
|
||||
Quicksuggest,
|
||||
Amp,
|
||||
Fakespot,
|
||||
Other,
|
||||
}
|
||||
|
||||
impl Collection {
|
||||
pub fn name(&self) -> &'static str {
|
||||
match self {
|
||||
Self::Quicksuggest => "quicksuggest",
|
||||
Self::Amp => "quicksuggest-amp",
|
||||
Self::Fakespot => "fakespot-suggest-products",
|
||||
Self::Other => "quicksuggest-other",
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -69,85 +72,59 @@ pub(crate) trait Client {
|
||||
/// client-side filtering.
|
||||
///
|
||||
/// Records that can't be parsed as [SuggestRecord] are ignored.
|
||||
fn get_records(&self, collection: Collection, dao: &mut SuggestDao) -> Result<Vec<Record>>;
|
||||
fn get_records(&self, collection: Collection) -> Result<Vec<Record>>;
|
||||
|
||||
fn download_attachment(&self, record: &Record) -> Result<Vec<u8>>;
|
||||
}
|
||||
|
||||
/// Implements the [Client] trait using a real remote settings client
|
||||
pub struct RemoteSettingsClient {
|
||||
pub struct SuggestRemoteSettingsClient {
|
||||
// Create a separate client for each collection name
|
||||
quicksuggest_client: remote_settings::RemoteSettings,
|
||||
fakespot_client: remote_settings::RemoteSettings,
|
||||
amp_client: Arc<RemoteSettingsClient>,
|
||||
other_client: Arc<RemoteSettingsClient>,
|
||||
fakespot_client: Arc<RemoteSettingsClient>,
|
||||
}
|
||||
|
||||
impl RemoteSettingsClient {
|
||||
pub fn new(
|
||||
server: Option<remote_settings::RemoteSettingsServer>,
|
||||
bucket_name: Option<String>,
|
||||
server_url: Option<String>,
|
||||
) -> Result<Self> {
|
||||
impl SuggestRemoteSettingsClient {
|
||||
pub fn new(rs_service: &RemoteSettingsService) -> Result<Self> {
|
||||
Ok(Self {
|
||||
quicksuggest_client: remote_settings::RemoteSettings::new(
|
||||
remote_settings::RemoteSettingsConfig {
|
||||
server: server.clone(),
|
||||
bucket_name: bucket_name.clone(),
|
||||
collection_name: "quicksuggest".to_owned(),
|
||||
server_url: server_url.clone(),
|
||||
},
|
||||
)?,
|
||||
fakespot_client: remote_settings::RemoteSettings::new(
|
||||
remote_settings::RemoteSettingsConfig {
|
||||
server,
|
||||
bucket_name,
|
||||
collection_name: "fakespot-suggest-products".to_owned(),
|
||||
server_url,
|
||||
},
|
||||
)?,
|
||||
amp_client: rs_service.make_client(Collection::Amp.name().to_owned())?,
|
||||
other_client: rs_service.make_client(Collection::Other.name().to_owned())?,
|
||||
fakespot_client: rs_service.make_client(Collection::Fakespot.name().to_owned())?,
|
||||
})
|
||||
}
|
||||
|
||||
fn client_for_collection(&self, collection: Collection) -> &remote_settings::RemoteSettings {
|
||||
fn client_for_collection(&self, collection: Collection) -> &RemoteSettingsClient {
|
||||
match collection {
|
||||
Collection::Amp => &self.amp_client,
|
||||
Collection::Other => &self.other_client,
|
||||
Collection::Fakespot => &self.fakespot_client,
|
||||
Collection::Quicksuggest => &self.quicksuggest_client,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Client for RemoteSettingsClient {
|
||||
fn get_records(&self, collection: Collection, dao: &mut SuggestDao) -> Result<Vec<Record>> {
|
||||
// For now, handle the cache manually. Once 6328 is merged, we should be able to delegate
|
||||
// this to remote_settings.
|
||||
impl Client for SuggestRemoteSettingsClient {
|
||||
fn get_records(&self, collection: Collection) -> Result<Vec<Record>> {
|
||||
let client = self.client_for_collection(collection);
|
||||
let cache = dao.read_cached_rs_data(collection.name());
|
||||
let last_modified = match &cache {
|
||||
Some(response) => response.last_modified,
|
||||
None => 0,
|
||||
};
|
||||
let response = match cache {
|
||||
None => client.get_records()?,
|
||||
Some(cache) => remote_settings::cache::merge_cache_and_response(
|
||||
cache,
|
||||
client.get_records_since(last_modified)?,
|
||||
),
|
||||
};
|
||||
if last_modified != response.last_modified {
|
||||
dao.write_cached_rs_data(collection.name(), &response);
|
||||
client.sync()?;
|
||||
let response = client.get_records(false);
|
||||
match response {
|
||||
Some(r) => Ok(r
|
||||
.into_iter()
|
||||
.filter_map(|r| Record::new(r, collection).ok())
|
||||
.collect()),
|
||||
None => Err(Error::RemoteSettings(RemoteSettingsError::Other {
|
||||
reason: "Unable to get records".to_owned(),
|
||||
})),
|
||||
}
|
||||
|
||||
Ok(response
|
||||
.records
|
||||
.into_iter()
|
||||
.filter_map(|r| Record::new(r, collection).ok())
|
||||
.collect())
|
||||
}
|
||||
|
||||
fn download_attachment(&self, record: &Record) -> Result<Vec<u8>> {
|
||||
let converted_record: RemoteSettingsRecord = record.clone().into();
|
||||
match &record.attachment {
|
||||
Some(a) => Ok(self
|
||||
Some(_) => Ok(self
|
||||
.client_for_collection(record.collection)
|
||||
.get_attachment(&a.location)?),
|
||||
.get_attachment(&converted_record)?),
|
||||
None => Err(Error::MissingAttachment(record.id.to_string())),
|
||||
}
|
||||
}
|
||||
@@ -181,17 +158,31 @@ impl Record {
|
||||
}
|
||||
}
|
||||
|
||||
impl From<Record> for RemoteSettingsRecord {
|
||||
fn from(record: Record) -> Self {
|
||||
RemoteSettingsRecord {
|
||||
id: record.id.to_string(),
|
||||
last_modified: record.last_modified,
|
||||
deleted: false,
|
||||
attachment: record.attachment.clone(),
|
||||
fields: record.payload.to_json_map(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// A record in the Suggest Remote Settings collection.
|
||||
///
|
||||
/// Most Suggest records don't carry inline fields except for `type`.
|
||||
/// Suggestions themselves are typically stored in each record's attachment.
|
||||
#[derive(Clone, Debug, Deserialize)]
|
||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||
#[serde(tag = "type")]
|
||||
pub(crate) enum SuggestRecord {
|
||||
#[serde(rename = "icon")]
|
||||
Icon,
|
||||
#[serde(rename = "data")]
|
||||
AmpWikipedia,
|
||||
#[serde(rename = "amp")]
|
||||
Amp,
|
||||
#[serde(rename = "wikipedia")]
|
||||
Wikipedia,
|
||||
#[serde(rename = "amo-suggestions")]
|
||||
Amo,
|
||||
#[serde(rename = "pocket-suggestions")]
|
||||
@@ -204,8 +195,6 @@ pub(crate) enum SuggestRecord {
|
||||
Weather,
|
||||
#[serde(rename = "configuration")]
|
||||
GlobalConfig(DownloadedGlobalConfig),
|
||||
#[serde(rename = "amp-mobile-suggestions")]
|
||||
AmpMobile,
|
||||
#[serde(rename = "fakespot-suggestions")]
|
||||
Fakespot,
|
||||
#[serde(rename = "exposure-suggestions")]
|
||||
@@ -214,20 +203,29 @@ pub(crate) enum SuggestRecord {
|
||||
Geonames,
|
||||
}
|
||||
|
||||
impl SuggestRecord {
|
||||
fn to_json_map(&self) -> Map<String, Value> {
|
||||
match serde_json::to_value(self) {
|
||||
Ok(Value::Object(map)) => map,
|
||||
_ => unreachable!(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Enum for the different record types that can be consumed.
|
||||
/// Extracting this from the serialization enum so that we can
|
||||
/// extend it to get type metadata.
|
||||
#[derive(Copy, Clone, PartialEq, PartialOrd, Eq, Ord, Hash)]
|
||||
pub enum SuggestRecordType {
|
||||
Icon,
|
||||
AmpWikipedia,
|
||||
Amp,
|
||||
Wikipedia,
|
||||
Amo,
|
||||
Pocket,
|
||||
Yelp,
|
||||
Mdn,
|
||||
Weather,
|
||||
GlobalConfig,
|
||||
AmpMobile,
|
||||
Fakespot,
|
||||
Exposure,
|
||||
Geonames,
|
||||
@@ -237,14 +235,14 @@ impl From<&SuggestRecord> for SuggestRecordType {
|
||||
fn from(suggest_record: &SuggestRecord) -> Self {
|
||||
match suggest_record {
|
||||
SuggestRecord::Amo => Self::Amo,
|
||||
SuggestRecord::AmpWikipedia => Self::AmpWikipedia,
|
||||
SuggestRecord::Amp => Self::Amp,
|
||||
SuggestRecord::Wikipedia => Self::Wikipedia,
|
||||
SuggestRecord::Icon => Self::Icon,
|
||||
SuggestRecord::Mdn => Self::Mdn,
|
||||
SuggestRecord::Pocket => Self::Pocket,
|
||||
SuggestRecord::Weather => Self::Weather,
|
||||
SuggestRecord::Yelp => Self::Yelp,
|
||||
SuggestRecord::GlobalConfig(_) => Self::GlobalConfig,
|
||||
SuggestRecord::AmpMobile => Self::AmpMobile,
|
||||
SuggestRecord::Fakespot => Self::Fakespot,
|
||||
SuggestRecord::Exposure(_) => Self::Exposure,
|
||||
SuggestRecord::Geonames => Self::Geonames,
|
||||
@@ -266,14 +264,14 @@ impl SuggestRecordType {
|
||||
pub fn all() -> &'static [SuggestRecordType] {
|
||||
&[
|
||||
Self::Icon,
|
||||
Self::AmpWikipedia,
|
||||
Self::Amp,
|
||||
Self::Wikipedia,
|
||||
Self::Amo,
|
||||
Self::Pocket,
|
||||
Self::Yelp,
|
||||
Self::Mdn,
|
||||
Self::Weather,
|
||||
Self::GlobalConfig,
|
||||
Self::AmpMobile,
|
||||
Self::Fakespot,
|
||||
Self::Exposure,
|
||||
Self::Geonames,
|
||||
@@ -283,26 +281,19 @@ impl SuggestRecordType {
|
||||
pub fn as_str(&self) -> &str {
|
||||
match self {
|
||||
Self::Icon => "icon",
|
||||
Self::AmpWikipedia => "data",
|
||||
Self::Amp => "amp",
|
||||
Self::Wikipedia => "wikipedia",
|
||||
Self::Amo => "amo-suggestions",
|
||||
Self::Pocket => "pocket-suggestions",
|
||||
Self::Yelp => "yelp-suggestions",
|
||||
Self::Mdn => "mdn-suggestions",
|
||||
Self::Weather => "weather",
|
||||
Self::GlobalConfig => "configuration",
|
||||
Self::AmpMobile => "amp-mobile-suggestions",
|
||||
Self::Fakespot => "fakespot-suggestions",
|
||||
Self::Exposure => "exposure-suggestions",
|
||||
Self::Geonames => "geonames",
|
||||
}
|
||||
}
|
||||
|
||||
pub fn collection(&self) -> Collection {
|
||||
match self {
|
||||
Self::Fakespot => Collection::Fakespot,
|
||||
_ => Collection::Quicksuggest,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Represents either a single value, or a list of values. This is used to
|
||||
@@ -359,22 +350,15 @@ impl fmt::Display for SuggestRecordId {
|
||||
}
|
||||
}
|
||||
|
||||
/// Fields that are common to all downloaded suggestions.
|
||||
/// An AMP suggestion to ingest from an AMP attachment.
|
||||
#[derive(Clone, Debug, Default, Deserialize)]
|
||||
pub(crate) struct DownloadedSuggestionCommonDetails {
|
||||
pub(crate) struct DownloadedAmpSuggestion {
|
||||
pub keywords: Vec<String>,
|
||||
pub title: String,
|
||||
pub url: String,
|
||||
pub score: Option<f64>,
|
||||
#[serde(default)]
|
||||
pub full_keywords: Vec<(String, usize)>,
|
||||
}
|
||||
|
||||
/// An AMP suggestion to ingest from an AMP-Wikipedia attachment.
|
||||
#[derive(Clone, Debug, Default, Deserialize)]
|
||||
pub(crate) struct DownloadedAmpSuggestion {
|
||||
#[serde(flatten)]
|
||||
pub common_details: DownloadedSuggestionCommonDetails,
|
||||
pub advertiser: String,
|
||||
#[serde(rename = "id")]
|
||||
pub block_id: i32,
|
||||
@@ -385,59 +369,45 @@ pub(crate) struct DownloadedAmpSuggestion {
|
||||
pub icon_id: String,
|
||||
}
|
||||
|
||||
/// A Wikipedia suggestion to ingest from an AMP-Wikipedia attachment.
|
||||
/// A Wikipedia suggestion to ingest from a Wikipedia attachment.
|
||||
#[derive(Clone, Debug, Default, Deserialize)]
|
||||
pub(crate) struct DownloadedWikipediaSuggestion {
|
||||
#[serde(flatten)]
|
||||
pub common_details: DownloadedSuggestionCommonDetails,
|
||||
pub keywords: Vec<String>,
|
||||
pub title: String,
|
||||
pub url: String,
|
||||
pub score: Option<f64>,
|
||||
#[serde(default)]
|
||||
pub full_keywords: Vec<(String, usize)>,
|
||||
#[serde(rename = "icon")]
|
||||
pub icon_id: String,
|
||||
}
|
||||
|
||||
/// A suggestion to ingest from an AMP-Wikipedia attachment downloaded from
|
||||
/// Remote Settings.
|
||||
#[derive(Clone, Debug)]
|
||||
pub(crate) enum DownloadedAmpWikipediaSuggestion {
|
||||
Amp(DownloadedAmpSuggestion),
|
||||
Wikipedia(DownloadedWikipediaSuggestion),
|
||||
/// Iterate over all AMP/Wikipedia-style keywords.
|
||||
pub fn iterate_keywords<'a>(
|
||||
keywords: &'a [String],
|
||||
full_keywords: &'a [(String, usize)],
|
||||
) -> impl Iterator<Item = AmpKeyword<'a>> {
|
||||
let full_keywords_iter = full_keywords
|
||||
.iter()
|
||||
.flat_map(|(full_keyword, repeat_for)| {
|
||||
std::iter::repeat(Some(full_keyword.as_str())).take(*repeat_for)
|
||||
})
|
||||
.chain(std::iter::repeat(None)); // In case of insufficient full keywords, just fill in with infinite `None`s
|
||||
//
|
||||
keywords
|
||||
.iter()
|
||||
.zip(full_keywords_iter)
|
||||
.enumerate()
|
||||
.map(move |(i, (keyword, full_keyword))| AmpKeyword {
|
||||
rank: i,
|
||||
keyword,
|
||||
full_keyword,
|
||||
})
|
||||
}
|
||||
|
||||
impl DownloadedAmpWikipediaSuggestion {
|
||||
/// Returns the details that are common to AMP and Wikipedia suggestions.
|
||||
pub fn common_details(&self) -> &DownloadedSuggestionCommonDetails {
|
||||
match self {
|
||||
Self::Amp(DownloadedAmpSuggestion { common_details, .. }) => common_details,
|
||||
Self::Wikipedia(DownloadedWikipediaSuggestion { common_details, .. }) => common_details,
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns the provider of this suggestion.
|
||||
pub fn provider(&self) -> SuggestionProvider {
|
||||
match self {
|
||||
DownloadedAmpWikipediaSuggestion::Amp(_) => SuggestionProvider::Amp,
|
||||
DownloadedAmpWikipediaSuggestion::Wikipedia(_) => SuggestionProvider::Wikipedia,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl DownloadedSuggestionCommonDetails {
|
||||
/// Iterate over all keywords for this suggestion
|
||||
impl DownloadedAmpSuggestion {
|
||||
pub fn keywords(&self) -> impl Iterator<Item = AmpKeyword<'_>> {
|
||||
let full_keywords = self
|
||||
.full_keywords
|
||||
.iter()
|
||||
.flat_map(|(full_keyword, repeat_for)| {
|
||||
std::iter::repeat(Some(full_keyword.as_str())).take(*repeat_for)
|
||||
})
|
||||
.chain(std::iter::repeat(None)); // In case of insufficient full keywords, just fill in with infinite `None`s
|
||||
//
|
||||
self.keywords.iter().zip(full_keywords).enumerate().map(
|
||||
move |(i, (keyword, full_keyword))| AmpKeyword {
|
||||
rank: i,
|
||||
keyword,
|
||||
full_keyword,
|
||||
},
|
||||
)
|
||||
iterate_keywords(&self.keywords, &self.full_keywords)
|
||||
}
|
||||
|
||||
pub fn full_keywords_fts_column(&self) -> String {
|
||||
@@ -445,6 +415,12 @@ impl DownloadedSuggestionCommonDetails {
|
||||
}
|
||||
}
|
||||
|
||||
impl DownloadedWikipediaSuggestion {
|
||||
pub fn keywords(&self) -> impl Iterator<Item = AmpKeyword<'_>> {
|
||||
iterate_keywords(&self.keywords, &self.full_keywords)
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, PartialEq, Eq)]
|
||||
pub(crate) struct AmpKeyword<'a> {
|
||||
pub rank: usize,
|
||||
@@ -452,44 +428,6 @@ pub(crate) struct AmpKeyword<'a> {
|
||||
pub full_keyword: Option<&'a str>,
|
||||
}
|
||||
|
||||
impl<'de> Deserialize<'de> for DownloadedAmpWikipediaSuggestion {
|
||||
fn deserialize<D>(
|
||||
deserializer: D,
|
||||
) -> std::result::Result<DownloadedAmpWikipediaSuggestion, D::Error>
|
||||
where
|
||||
D: Deserializer<'de>,
|
||||
{
|
||||
// AMP and Wikipedia suggestions use the same schema. To separate them,
|
||||
// we use a "maybe tagged" outer enum with tagged and untagged variants,
|
||||
// and a "tagged" inner enum.
|
||||
//
|
||||
// Wikipedia suggestions will deserialize successfully into the tagged
|
||||
// variant. AMP suggestions will try the tagged variant, fail, and fall
|
||||
// back to the untagged variant.
|
||||
//
|
||||
// This approach works around serde-rs/serde#912.
|
||||
|
||||
#[derive(Deserialize)]
|
||||
#[serde(untagged)]
|
||||
enum MaybeTagged {
|
||||
Tagged(Tagged),
|
||||
Untagged(DownloadedAmpSuggestion),
|
||||
}
|
||||
|
||||
#[derive(Deserialize)]
|
||||
#[serde(tag = "advertiser")]
|
||||
enum Tagged {
|
||||
#[serde(rename = "Wikipedia")]
|
||||
Wikipedia(DownloadedWikipediaSuggestion),
|
||||
}
|
||||
|
||||
Ok(match MaybeTagged::deserialize(deserializer)? {
|
||||
MaybeTagged::Tagged(Tagged::Wikipedia(wikipedia)) => Self::Wikipedia(wikipedia),
|
||||
MaybeTagged::Untagged(amp) => Self::Amp(amp),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
/// An AMO suggestion to ingest from an attachment
|
||||
#[derive(Clone, Debug, Deserialize)]
|
||||
pub(crate) struct DownloadedAmoSuggestion {
|
||||
@@ -564,7 +502,7 @@ pub(crate) struct DownloadedFakespotSuggestion {
|
||||
}
|
||||
|
||||
/// An exposure suggestion record's inline data
|
||||
#[derive(Clone, Debug, Deserialize)]
|
||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||
pub(crate) struct DownloadedExposureRecord {
|
||||
pub suggestion_type: String,
|
||||
}
|
||||
@@ -644,11 +582,11 @@ impl FullOrPrefixKeywords<String> {
|
||||
}
|
||||
|
||||
/// Global Suggest configuration data to ingest from a configuration record
|
||||
#[derive(Clone, Debug, Deserialize)]
|
||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||
pub(crate) struct DownloadedGlobalConfig {
|
||||
pub configuration: DownloadedGlobalConfigInner,
|
||||
}
|
||||
#[derive(Clone, Debug, Deserialize)]
|
||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||
pub(crate) struct DownloadedGlobalConfigInner {
|
||||
/// The maximum number of times the user can click "Show less frequently"
|
||||
/// for a suggestion in the UI.
|
||||
@@ -670,24 +608,21 @@ mod test {
|
||||
|
||||
#[test]
|
||||
fn test_full_keywords() {
|
||||
let suggestion = DownloadedAmpWikipediaSuggestion::Amp(DownloadedAmpSuggestion {
|
||||
common_details: DownloadedSuggestionCommonDetails {
|
||||
keywords: vec![
|
||||
String::from("f"),
|
||||
String::from("fo"),
|
||||
String::from("foo"),
|
||||
String::from("foo b"),
|
||||
String::from("foo ba"),
|
||||
String::from("foo bar"),
|
||||
],
|
||||
full_keywords: vec![(String::from("foo"), 3), (String::from("foo bar"), 3)],
|
||||
..DownloadedSuggestionCommonDetails::default()
|
||||
},
|
||||
let suggestion = DownloadedAmpSuggestion {
|
||||
keywords: vec![
|
||||
String::from("f"),
|
||||
String::from("fo"),
|
||||
String::from("foo"),
|
||||
String::from("foo b"),
|
||||
String::from("foo ba"),
|
||||
String::from("foo bar"),
|
||||
],
|
||||
full_keywords: vec![(String::from("foo"), 3), (String::from("foo bar"), 3)],
|
||||
..DownloadedAmpSuggestion::default()
|
||||
});
|
||||
};
|
||||
|
||||
assert_eq!(
|
||||
Vec::from_iter(suggestion.common_details().keywords()),
|
||||
Vec::from_iter(suggestion.keywords()),
|
||||
vec![
|
||||
AmpKeyword {
|
||||
rank: 0,
|
||||
@@ -725,25 +660,22 @@ mod test {
|
||||
|
||||
#[test]
|
||||
fn test_missing_full_keywords() {
|
||||
let suggestion = DownloadedAmpWikipediaSuggestion::Amp(DownloadedAmpSuggestion {
|
||||
common_details: DownloadedSuggestionCommonDetails {
|
||||
keywords: vec![
|
||||
String::from("f"),
|
||||
String::from("fo"),
|
||||
String::from("foo"),
|
||||
String::from("foo b"),
|
||||
String::from("foo ba"),
|
||||
String::from("foo bar"),
|
||||
],
|
||||
// Only the first 3 keywords have full keywords associated with them
|
||||
full_keywords: vec![(String::from("foo"), 3)],
|
||||
..DownloadedSuggestionCommonDetails::default()
|
||||
},
|
||||
let suggestion = DownloadedAmpSuggestion {
|
||||
keywords: vec![
|
||||
String::from("f"),
|
||||
String::from("fo"),
|
||||
String::from("foo"),
|
||||
String::from("foo b"),
|
||||
String::from("foo ba"),
|
||||
String::from("foo bar"),
|
||||
],
|
||||
// Only the first 3 keywords have full keywords associated with them
|
||||
full_keywords: vec![(String::from("foo"), 3)],
|
||||
..DownloadedAmpSuggestion::default()
|
||||
});
|
||||
};
|
||||
|
||||
assert_eq!(
|
||||
Vec::from_iter(suggestion.common_details().keywords()),
|
||||
Vec::from_iter(suggestion.keywords()),
|
||||
vec![
|
||||
AmpKeyword {
|
||||
rank: 0,
|
||||
|
||||
29
third_party/rust/suggest/src/schema.rs
vendored
29
third_party/rust/suggest/src/schema.rs
vendored
@@ -23,7 +23,7 @@ use sql_support::{
|
||||
/// `clear_database()` by adding their names to `conditional_tables`, unless
|
||||
/// they are cleared via a deletion trigger or there's some other good
|
||||
/// reason not to do so.
|
||||
pub const VERSION: u32 = 32;
|
||||
pub const VERSION: u32 = 33;
|
||||
|
||||
/// The current Suggest database schema.
|
||||
pub const SQL: &str = "
|
||||
@@ -32,11 +32,6 @@ CREATE TABLE meta(
|
||||
value NOT NULL
|
||||
) WITHOUT ROWID;
|
||||
|
||||
CREATE TABLE rs_cache(
|
||||
collection TEXT PRIMARY KEY,
|
||||
data TEXT NOT NULL
|
||||
) WITHOUT ROWID;
|
||||
|
||||
CREATE TABLE ingested_records(
|
||||
id TEXT,
|
||||
collection TEXT,
|
||||
@@ -616,6 +611,11 @@ impl ConnectionInitializer for SuggestConnectionInitializer<'_> {
|
||||
)?;
|
||||
Ok(())
|
||||
}
|
||||
32 => {
|
||||
// Drop rs_cache since it's no longer needed.
|
||||
tx.execute_batch("DROP TABLE rs_cache;")?;
|
||||
Ok(())
|
||||
}
|
||||
_ => Err(open_database::Error::IncompatibleVersion(version)),
|
||||
}
|
||||
}
|
||||
@@ -643,7 +643,6 @@ pub fn clear_database(db: &Connection) -> rusqlite::Result<()> {
|
||||
"geonames_metrics",
|
||||
"ingested_records",
|
||||
"keywords_metrics",
|
||||
"rs_cache",
|
||||
];
|
||||
for t in conditional_tables {
|
||||
let table_exists = db.exists("SELECT 1 FROM sqlite_master WHERE name = ?", [t])?;
|
||||
@@ -792,38 +791,28 @@ PRAGMA user_version=16;
|
||||
let db_file =
|
||||
MigratedDatabaseFile::new(SuggestConnectionInitializer::default(), V16_SCHEMA);
|
||||
|
||||
// Upgrade to v25, the first version with with `ingested_records` and
|
||||
// `rs_cache` tables.
|
||||
// Upgrade to v25, the first version with with `ingested_records` tables.
|
||||
db_file.upgrade_to(25);
|
||||
|
||||
// Insert some ingested records and cache data.
|
||||
// Insert some ingested records.
|
||||
let conn = db_file.open();
|
||||
conn.execute(
|
||||
"INSERT INTO ingested_records(id, collection, type, last_modified) VALUES(?, ?, ?, ?)",
|
||||
("record-id", "quicksuggest", "record-type", 1),
|
||||
)?;
|
||||
conn.execute(
|
||||
"INSERT INTO rs_cache(collection, data) VALUES(?, ?)",
|
||||
("quicksuggest", "some data"),
|
||||
)?;
|
||||
conn.close().expect("Connection should be closed");
|
||||
|
||||
// Finish upgrading to the current version.
|
||||
db_file.upgrade_to(VERSION);
|
||||
db_file.assert_schema_matches_new_database();
|
||||
|
||||
// `ingested_records` and `rs_cache` should be empty.
|
||||
// `ingested_records` should be empty.
|
||||
let conn = db_file.open();
|
||||
assert_eq!(
|
||||
conn.query_one::<i32>("SELECT count(*) FROM ingested_records")?,
|
||||
0,
|
||||
"ingested_records should be empty"
|
||||
);
|
||||
assert_eq!(
|
||||
conn.query_one::<i32>("SELECT count(*) FROM rs_cache")?,
|
||||
0,
|
||||
"rs_cache should be empty"
|
||||
);
|
||||
conn.close().expect("Connection should be closed");
|
||||
|
||||
Ok(())
|
||||
|
||||
725
third_party/rust/suggest/src/store.rs
vendored
725
third_party/rust/suggest/src/store.rs
vendored
File diff suppressed because it is too large
Load Diff
5
third_party/rust/suggest/src/suggestion.rs
vendored
5
third_party/rust/suggest/src/suggestion.rs
vendored
@@ -16,11 +16,6 @@ const TIMESTAMP_TEMPLATE: &str = "%YYYYMMDDHH%";
|
||||
/// 2 bytes shorter than [`TIMESTAMP_TEMPLATE`].
|
||||
const TIMESTAMP_LENGTH: usize = 10;
|
||||
|
||||
/// Suggestion Types for Amp
|
||||
pub(crate) enum AmpSuggestionType {
|
||||
Mobile,
|
||||
Desktop,
|
||||
}
|
||||
/// A suggestion from the database to show in the address bar.
|
||||
#[derive(Clone, Debug, PartialEq, uniffi::Enum)]
|
||||
pub enum Suggestion {
|
||||
|
||||
317
third_party/rust/suggest/src/testing/client.rs
vendored
317
third_party/rust/suggest/src/testing/client.rs
vendored
@@ -9,7 +9,6 @@ use serde_json::json;
|
||||
use serde_json::Value as JsonValue;
|
||||
|
||||
use crate::{
|
||||
db::SuggestDao,
|
||||
error::Error,
|
||||
rs::{Client, Collection, Record, SuggestRecordId, SuggestRecordType},
|
||||
testing::JsonExt,
|
||||
@@ -36,148 +35,19 @@ impl Default for MockRemoteSettingsClient {
|
||||
}
|
||||
}
|
||||
|
||||
fn record_type_for_str(record_type_str: &str) -> SuggestRecordType {
|
||||
for record_type in SuggestRecordType::all() {
|
||||
if record_type.as_str() == record_type_str {
|
||||
return *record_type;
|
||||
}
|
||||
}
|
||||
panic!("Invalid record type string: {record_type_str}");
|
||||
}
|
||||
|
||||
impl MockRemoteSettingsClient {
|
||||
// Consuming Builder API, this is best for constructing the initial client
|
||||
pub fn with_record(mut self, record_type: &str, record_id: &str, items: JsonValue) -> Self {
|
||||
self.add_record(record_type, record_id, items);
|
||||
self
|
||||
}
|
||||
|
||||
pub fn with_icon(mut self, icon: MockIcon) -> Self {
|
||||
self.add_icon(icon);
|
||||
self
|
||||
}
|
||||
|
||||
pub fn with_record_but_no_attachment(mut self, record_type: &str, record_id: &str) -> Self {
|
||||
self.add_record_but_no_attachment(record_type, record_id);
|
||||
self
|
||||
}
|
||||
|
||||
pub fn with_inline_record(
|
||||
mut self,
|
||||
record_type: &str,
|
||||
record_id: &str,
|
||||
inline_data: JsonValue,
|
||||
) -> Self {
|
||||
self.add_inline_record(record_type, record_id, inline_data);
|
||||
self
|
||||
}
|
||||
|
||||
pub fn with_full_record(
|
||||
mut self,
|
||||
record_type: &str,
|
||||
record_id: &str,
|
||||
inline_data: Option<JsonValue>,
|
||||
items: Option<JsonValue>,
|
||||
) -> Self {
|
||||
self.add_full_record(record_type, record_id, inline_data, items);
|
||||
pub fn with_record(mut self, record: MockRecord) -> Self {
|
||||
self.add_record(record);
|
||||
self
|
||||
}
|
||||
|
||||
// Non-Consuming Builder API, this is best for updating an existing client
|
||||
|
||||
/// Add a record to the mock data
|
||||
///
|
||||
/// A single record typically contains multiple items in the attachment data. Pass all of them
|
||||
/// as the `items` param.
|
||||
pub fn add_record(
|
||||
&mut self,
|
||||
record_type: &str,
|
||||
record_id: &str,
|
||||
items: JsonValue,
|
||||
) -> &mut Self {
|
||||
self.add_full_record(record_type, record_id, None, Some(items))
|
||||
}
|
||||
|
||||
/// Add a record for an icon to the mock data
|
||||
pub fn add_icon(&mut self, icon: MockIcon) -> &mut Self {
|
||||
let icon_id = icon.id;
|
||||
let record_id = format!("icon-{icon_id}");
|
||||
let location = format!("icon-{icon_id}.png");
|
||||
self.records.push(Record {
|
||||
id: SuggestRecordId::new(record_id.to_string()),
|
||||
last_modified: self.last_modified_timestamp,
|
||||
collection: Collection::Quicksuggest,
|
||||
attachment: Some(Attachment {
|
||||
filename: location.clone(),
|
||||
mimetype: icon.mimetype.into(),
|
||||
hash: "".into(),
|
||||
size: 0,
|
||||
location: location.clone(),
|
||||
}),
|
||||
payload: serde_json::from_value(json!({"type": "icon"})).unwrap(),
|
||||
});
|
||||
self.attachments
|
||||
.insert(location, icon.data.as_bytes().to_vec());
|
||||
self
|
||||
}
|
||||
|
||||
/// Add a record without attachment data
|
||||
pub fn add_record_but_no_attachment(
|
||||
&mut self,
|
||||
record_type: &str,
|
||||
record_id: &str,
|
||||
) -> &mut Self {
|
||||
self.add_full_record(record_type, record_id, None, None)
|
||||
}
|
||||
|
||||
/// Add a record to the mock data, with data stored inline rather than in an attachment
|
||||
///
|
||||
/// Use this for record types like weather where the data it stored in the record itself rather
|
||||
/// than in an attachment.
|
||||
pub fn add_inline_record(
|
||||
&mut self,
|
||||
record_type: &str,
|
||||
record_id: &str,
|
||||
inline_data: JsonValue,
|
||||
) -> &mut Self {
|
||||
self.add_full_record(record_type, record_id, Some(inline_data), None)
|
||||
}
|
||||
|
||||
/// Add a record with optional extra fields stored inline and attachment
|
||||
/// items
|
||||
pub fn add_full_record(
|
||||
&mut self,
|
||||
record_type: &str,
|
||||
record_id: &str,
|
||||
inline_data: Option<JsonValue>,
|
||||
items: Option<JsonValue>,
|
||||
) -> &mut Self {
|
||||
let location = format!("{record_type}-{record_id}.json");
|
||||
self.records.push(Record {
|
||||
id: SuggestRecordId::new(record_id.to_string()),
|
||||
collection: record_type_for_str(record_type).collection(),
|
||||
last_modified: self.last_modified_timestamp,
|
||||
payload: serde_json::from_value(
|
||||
json!({
|
||||
"type": record_type,
|
||||
})
|
||||
.merge(inline_data.unwrap_or(json!({}))),
|
||||
)
|
||||
.unwrap(),
|
||||
attachment: items.as_ref().map(|_| Attachment {
|
||||
filename: location.clone(),
|
||||
mimetype: "application/json".into(),
|
||||
hash: "".into(),
|
||||
size: 0,
|
||||
location: location.clone(),
|
||||
}),
|
||||
});
|
||||
if let Some(i) = items {
|
||||
self.attachments.insert(
|
||||
location,
|
||||
serde_json::to_vec(&i).expect("error serializing attachment data"),
|
||||
);
|
||||
}
|
||||
pub fn add_record(&mut self, mock_record: MockRecord) -> &mut Self {
|
||||
self.insert_attachment(&mock_record);
|
||||
self.records.push(self.record_from_mock(mock_record));
|
||||
self
|
||||
}
|
||||
|
||||
@@ -185,90 +55,61 @@ impl MockRemoteSettingsClient {
|
||||
// clients
|
||||
|
||||
/// Update a record, storing a new payload and bumping the modified time
|
||||
pub fn update_record(
|
||||
&mut self,
|
||||
record_type: &str,
|
||||
record_id: &str,
|
||||
items: JsonValue,
|
||||
) -> &mut Self {
|
||||
let record = self
|
||||
.records
|
||||
.iter_mut()
|
||||
.find(|r| r.id.as_str() == record_id)
|
||||
.unwrap_or_else(|| panic!("update_record: {record_id} not found"));
|
||||
let attachment_data = self
|
||||
.attachments
|
||||
.get_mut(
|
||||
&record
|
||||
.attachment
|
||||
.as_ref()
|
||||
.expect("update_record: no attachment")
|
||||
.location,
|
||||
)
|
||||
.unwrap_or_else(|| panic!("update_record: attachment not found for {record_id}"));
|
||||
|
||||
record.last_modified += 1;
|
||||
record.payload = serde_json::from_value(json!({"type": record_type})).unwrap();
|
||||
*attachment_data = serde_json::to_vec(&items).expect("error serializing attachment data");
|
||||
self
|
||||
}
|
||||
|
||||
/// Update an icon record, storing a new payload and bumping the modified time
|
||||
pub fn update_icon(&mut self, icon: MockIcon) -> &mut Self {
|
||||
let icon_id = &icon.id;
|
||||
let record_id = format!("icon-{icon_id}");
|
||||
let record = self
|
||||
.records
|
||||
.iter_mut()
|
||||
.find(|r| r.id.as_str() == record_id)
|
||||
.unwrap_or_else(|| panic!("update_icon: {record_id} not found"));
|
||||
let attachment_data = self
|
||||
.attachments
|
||||
.get_mut(
|
||||
&record
|
||||
.attachment
|
||||
.as_ref()
|
||||
.expect("update_icon: no attachment")
|
||||
.location,
|
||||
)
|
||||
.unwrap_or_else(|| panic!("update_icon: attachment not found for {icon_id}"));
|
||||
|
||||
record.last_modified += 1;
|
||||
*attachment_data = icon.data.as_bytes().to_vec();
|
||||
self
|
||||
}
|
||||
|
||||
/// Delete a record and it's attachment
|
||||
pub fn delete_record(&mut self, collection: &str, record_id: &str) -> &mut Self {
|
||||
let idx = self
|
||||
pub fn update_record(&mut self, mock_record: MockRecord) -> &mut Self {
|
||||
let index = self
|
||||
.records
|
||||
.iter()
|
||||
.position(|r| r.id.as_str() == record_id && r.collection.name() == collection)
|
||||
.unwrap_or_else(|| panic!("delete_record: {collection}:{record_id} not found"));
|
||||
let deleted = self.records.remove(idx);
|
||||
if let Some(a) = deleted.attachment {
|
||||
self.attachments.remove(&a.location);
|
||||
}
|
||||
.position(|r| mock_record.matches_record(r))
|
||||
.unwrap_or_else(|| panic!("update_record: {} not found", mock_record.qualified_id()));
|
||||
|
||||
self.insert_attachment(&mock_record);
|
||||
|
||||
let mut record = self.record_from_mock(mock_record);
|
||||
record.last_modified += 1;
|
||||
self.records.splice(index..=index, std::iter::once(record));
|
||||
|
||||
self
|
||||
}
|
||||
|
||||
pub fn delete_icon(&mut self, icon: MockIcon) -> &mut Self {
|
||||
self.delete_record("quicksuggest", &format!("icon-{}", icon.id))
|
||||
/// Delete a record and its attachment
|
||||
pub fn delete_record(&mut self, mock_record: MockRecord) -> &mut Self {
|
||||
let index = self
|
||||
.records
|
||||
.iter()
|
||||
.position(|r| mock_record.matches_record(r))
|
||||
.unwrap_or_else(|| panic!("delete_record: {} not found", mock_record.qualified_id()));
|
||||
self.records.remove(index);
|
||||
self.attachments.remove(&mock_record.qualified_id());
|
||||
self
|
||||
}
|
||||
}
|
||||
|
||||
pub struct MockIcon {
|
||||
pub id: &'static str,
|
||||
pub data: &'static str,
|
||||
pub mimetype: &'static str,
|
||||
pub fn insert_attachment(&mut self, mock_record: &MockRecord) {
|
||||
if let Some(bytes) = mock_record.attachment.as_ref().map(|a| match a {
|
||||
MockAttachment::Json(items) => serde_json::to_vec(&items).unwrap_or_else(|_| {
|
||||
panic!(
|
||||
"error serializing attachment data: {}",
|
||||
mock_record.qualified_id()
|
||||
)
|
||||
}),
|
||||
MockAttachment::Icon(icon) => icon.data.as_bytes().to_vec(),
|
||||
}) {
|
||||
self.attachments.insert(mock_record.qualified_id(), bytes);
|
||||
}
|
||||
}
|
||||
|
||||
fn record_from_mock(&self, mock_record: MockRecord) -> Record {
|
||||
let mut record: Record = mock_record.into();
|
||||
record.last_modified = self.last_modified_timestamp;
|
||||
record
|
||||
}
|
||||
}
|
||||
|
||||
impl Client for MockRemoteSettingsClient {
|
||||
fn get_records(&self, collection: Collection, _db: &mut SuggestDao) -> Result<Vec<Record>> {
|
||||
fn get_records(&self, collection: Collection) -> Result<Vec<Record>> {
|
||||
Ok(self
|
||||
.records
|
||||
.iter()
|
||||
.filter(|r| collection == r.record_type().collection())
|
||||
.filter(|r| collection == r.collection)
|
||||
.cloned()
|
||||
.collect())
|
||||
}
|
||||
@@ -284,3 +125,67 @@ impl Client for MockRemoteSettingsClient {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub struct MockRecord {
|
||||
pub collection: Collection,
|
||||
pub record_type: SuggestRecordType,
|
||||
pub id: String,
|
||||
pub inline_data: Option<JsonValue>,
|
||||
pub attachment: Option<MockAttachment>,
|
||||
}
|
||||
|
||||
impl MockRecord {
|
||||
pub fn qualified_id(&self) -> String {
|
||||
format!("{}:{}", self.collection.name(), self.id)
|
||||
}
|
||||
|
||||
fn matches_record(&self, record: &Record) -> bool {
|
||||
self.collection == record.collection && self.id.as_str() == record.id.as_str()
|
||||
}
|
||||
}
|
||||
|
||||
impl From<MockRecord> for Record {
|
||||
fn from(mock_record: MockRecord) -> Self {
|
||||
let attachment = mock_record.attachment.as_ref().map(|a| match a {
|
||||
MockAttachment::Json(_) => Attachment {
|
||||
filename: mock_record.id.to_string(),
|
||||
location: mock_record.qualified_id(),
|
||||
mimetype: "application/json".into(),
|
||||
hash: "".into(),
|
||||
size: 0,
|
||||
},
|
||||
MockAttachment::Icon(icon) => Attachment {
|
||||
filename: mock_record.id.to_string(),
|
||||
location: mock_record.qualified_id(),
|
||||
mimetype: icon.mimetype.to_string(),
|
||||
hash: "".into(),
|
||||
size: 0,
|
||||
},
|
||||
});
|
||||
|
||||
Self {
|
||||
id: SuggestRecordId::new(mock_record.id),
|
||||
collection: mock_record.collection,
|
||||
last_modified: 0,
|
||||
payload: serde_json::from_value(
|
||||
json!({
|
||||
"type": mock_record.record_type.as_str(),
|
||||
})
|
||||
.merge(mock_record.inline_data.unwrap_or(json!({}))),
|
||||
)
|
||||
.unwrap(),
|
||||
attachment,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub enum MockAttachment {
|
||||
Json(JsonValue),
|
||||
Icon(MockIcon),
|
||||
}
|
||||
|
||||
pub struct MockIcon {
|
||||
pub id: &'static str,
|
||||
pub data: &'static str,
|
||||
pub mimetype: &'static str,
|
||||
}
|
||||
|
||||
34
third_party/rust/suggest/src/testing/data.rs
vendored
34
third_party/rust/suggest/src/testing/data.rs
vendored
@@ -157,40 +157,6 @@ pub fn caltech_suggestion(full_keyword: &str) -> Suggestion {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn a1a_amp_mobile() -> JsonValue {
|
||||
json!({
|
||||
"id": 300,
|
||||
"advertiser": "A1A Car Wash",
|
||||
"iab_category": "2 - Auto",
|
||||
"keywords": ["a1a", "ca", "car", "car wash"],
|
||||
"title": "A1A Car Wash",
|
||||
"url": "https://www.a1a-wash.biz",
|
||||
"icon": "200",
|
||||
"impression_url": "https://example.com/impression_url",
|
||||
"click_url": "https://example.com/click_url",
|
||||
"score": 0.3
|
||||
})
|
||||
}
|
||||
|
||||
pub fn a1a_suggestion(full_keyword: &str, fts_match_info: Option<FtsMatchInfo>) -> Suggestion {
|
||||
Suggestion::Amp {
|
||||
title: "A1A Car Wash".into(),
|
||||
url: "https://www.a1a-wash.biz".into(),
|
||||
raw_url: "https://www.a1a-wash.biz".into(),
|
||||
icon: None,
|
||||
icon_mimetype: None,
|
||||
block_id: 300,
|
||||
advertiser: "A1A Car Wash".into(),
|
||||
iab_category: "2 - Auto".into(),
|
||||
impression_url: "https://example.com/impression_url".into(),
|
||||
click_url: "https://example.com/click_url".into(),
|
||||
raw_click_url: "https://example.com/click_url".into(),
|
||||
score: 0.3,
|
||||
full_keyword: full_keyword.to_string(),
|
||||
fts_match_info,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn relay_amo() -> JsonValue {
|
||||
json!({
|
||||
"title": "Firefox Relay",
|
||||
|
||||
2
third_party/rust/suggest/src/testing/mod.rs
vendored
2
third_party/rust/suggest/src/testing/mod.rs
vendored
@@ -5,7 +5,7 @@
|
||||
mod client;
|
||||
mod data;
|
||||
|
||||
pub use client::{MockIcon, MockRemoteSettingsClient};
|
||||
pub use client::{MockAttachment, MockIcon, MockRecord, MockRemoteSettingsClient};
|
||||
pub use data::*;
|
||||
|
||||
use crate::Suggestion;
|
||||
|
||||
127
third_party/rust/suggest/src/weather.rs
vendored
127
third_party/rust/suggest/src/weather.rs
vendored
@@ -494,15 +494,16 @@ mod tests {
|
||||
fn weather_provider_config() -> anyhow::Result<()> {
|
||||
before_each();
|
||||
let store = TestStore::new(MockRemoteSettingsClient::default().with_record(
|
||||
"weather",
|
||||
"weather-1",
|
||||
json!({
|
||||
"min_keyword_length": 3,
|
||||
"keywords": ["ab", "xyz", "weather"],
|
||||
"max_keyword_length": "weather".len(),
|
||||
"max_keyword_word_count": 1,
|
||||
"score": 0.24
|
||||
}),
|
||||
SuggestionProvider::Weather.record(
|
||||
"weather-1",
|
||||
json!({
|
||||
"min_keyword_length": 3,
|
||||
"keywords": ["ab", "xyz", "weather"],
|
||||
"max_keyword_length": "weather".len(),
|
||||
"max_keyword_word_count": 1,
|
||||
"score": 0.24
|
||||
}),
|
||||
),
|
||||
));
|
||||
store.ingest(SuggestIngestionConstraints {
|
||||
providers: Some(vec![SuggestionProvider::Weather]),
|
||||
@@ -523,16 +524,17 @@ mod tests {
|
||||
before_each();
|
||||
|
||||
let store = TestStore::new(MockRemoteSettingsClient::default().with_record(
|
||||
"weather",
|
||||
"weather-1",
|
||||
json!({
|
||||
// min_keyword_length > 0 means prefixes are allowed.
|
||||
"min_keyword_length": 5,
|
||||
"keywords": ["ab", "xyz", "cdefg", "weather"],
|
||||
"max_keyword_length": "weather".len(),
|
||||
"max_keyword_word_count": 1,
|
||||
"score": 0.24
|
||||
}),
|
||||
SuggestionProvider::Weather.record(
|
||||
"weather-1",
|
||||
json!({
|
||||
// min_keyword_length > 0 means prefixes are allowed.
|
||||
"min_keyword_length": 5,
|
||||
"keywords": ["ab", "xyz", "cdefg", "weather"],
|
||||
"max_keyword_length": "weather".len(),
|
||||
"max_keyword_word_count": 1,
|
||||
"score": 0.24
|
||||
}),
|
||||
),
|
||||
));
|
||||
|
||||
store.ingest(SuggestIngestionConstraints {
|
||||
@@ -600,16 +602,17 @@ mod tests {
|
||||
before_each();
|
||||
|
||||
let store = TestStore::new(MockRemoteSettingsClient::default().with_record(
|
||||
"weather",
|
||||
"weather-1",
|
||||
json!({
|
||||
// min_keyword_length == 0 means prefixes are not allowed.
|
||||
"min_keyword_length": 0,
|
||||
"keywords": ["weather"],
|
||||
"max_keyword_length": "weather".len(),
|
||||
"max_keyword_word_count": 1,
|
||||
"score": 0.24
|
||||
}),
|
||||
SuggestionProvider::Weather.record(
|
||||
"weather-1",
|
||||
json!({
|
||||
// min_keyword_length == 0 means prefixes are not allowed.
|
||||
"min_keyword_length": 0,
|
||||
"keywords": ["weather"],
|
||||
"max_keyword_length": "weather".len(),
|
||||
"max_keyword_word_count": 1,
|
||||
"score": 0.24
|
||||
}),
|
||||
),
|
||||
));
|
||||
|
||||
store.ingest(SuggestIngestionConstraints {
|
||||
@@ -645,21 +648,22 @@ mod tests {
|
||||
before_each();
|
||||
|
||||
let mut store = geoname::tests::new_test_store();
|
||||
store.client_mut().add_record(
|
||||
"weather",
|
||||
"weather-1",
|
||||
json!({
|
||||
// Include a keyword that's a prefix of another keyword --
|
||||
// "weather" and "weather near me" -- so that when a test
|
||||
// matches both we can verify only one suggestion is returned,
|
||||
// not two.
|
||||
"keywords": ["ab", "xyz", "weather", "weather near me"],
|
||||
"min_keyword_length": 5,
|
||||
"max_keyword_length": "weather".len(),
|
||||
"max_keyword_word_count": 1,
|
||||
"score": 0.24
|
||||
}),
|
||||
);
|
||||
store
|
||||
.client_mut()
|
||||
.add_record(SuggestionProvider::Weather.record(
|
||||
"weather-1",
|
||||
json!({
|
||||
// Include a keyword that's a prefix of another keyword --
|
||||
// "weather" and "weather near me" -- so that when a test
|
||||
// matches both we can verify only one suggestion is returned,
|
||||
// not two.
|
||||
"keywords": ["ab", "xyz", "weather", "weather near me"],
|
||||
"min_keyword_length": 5,
|
||||
"max_keyword_length": "weather".len(),
|
||||
"max_keyword_word_count": 1,
|
||||
"score": 0.24
|
||||
}),
|
||||
));
|
||||
|
||||
store.ingest(SuggestIngestionConstraints {
|
||||
providers: Some(vec![SuggestionProvider::Weather]),
|
||||
@@ -1480,8 +1484,7 @@ mod tests {
|
||||
// metrics so the other values don't matter.
|
||||
let mut store = TestStore::new(
|
||||
MockRemoteSettingsClient::default()
|
||||
.with_record(
|
||||
"weather",
|
||||
.with_record(SuggestionProvider::Weather.record(
|
||||
"weather-0",
|
||||
json!({
|
||||
"max_keyword_length": 10,
|
||||
@@ -1490,9 +1493,8 @@ mod tests {
|
||||
"score": 0.24,
|
||||
"keywords": []
|
||||
}),
|
||||
)
|
||||
.with_record(
|
||||
"weather",
|
||||
))
|
||||
.with_record(SuggestionProvider::Weather.record(
|
||||
"weather-1",
|
||||
json!({
|
||||
"max_keyword_length": 20,
|
||||
@@ -1501,7 +1503,7 @@ mod tests {
|
||||
"score": 0.24,
|
||||
"keywords": []
|
||||
}),
|
||||
),
|
||||
)),
|
||||
);
|
||||
|
||||
store.ingest(SuggestIngestionConstraints {
|
||||
@@ -1519,7 +1521,7 @@ mod tests {
|
||||
// Delete the first record. The metrics should change.
|
||||
store
|
||||
.client_mut()
|
||||
.delete_record("quicksuggest", "weather-0");
|
||||
.delete_record(SuggestionProvider::Weather.empty_record("weather-0"));
|
||||
store.ingest(SuggestIngestionConstraints {
|
||||
providers: Some(vec![SuggestionProvider::Weather]),
|
||||
..SuggestIngestionConstraints::all_providers()
|
||||
@@ -1532,17 +1534,18 @@ mod tests {
|
||||
})?;
|
||||
|
||||
// Add a new record. The metrics should change again.
|
||||
store.client_mut().add_record(
|
||||
"weather",
|
||||
"weather-3",
|
||||
json!({
|
||||
"max_keyword_length": 15,
|
||||
"max_keyword_word_count": 3,
|
||||
"min_keyword_length": 3,
|
||||
"score": 0.24,
|
||||
"keywords": []
|
||||
}),
|
||||
);
|
||||
store
|
||||
.client_mut()
|
||||
.add_record(SuggestionProvider::Weather.record(
|
||||
"weather-3",
|
||||
json!({
|
||||
"max_keyword_length": 15,
|
||||
"max_keyword_word_count": 3,
|
||||
"min_keyword_length": 3,
|
||||
"score": 0.24,
|
||||
"keywords": []
|
||||
}),
|
||||
));
|
||||
store.ingest(SuggestIngestionConstraints {
|
||||
providers: Some(vec![SuggestionProvider::Weather]),
|
||||
..SuggestIngestionConstraints::all_providers()
|
||||
|
||||
@@ -765,6 +765,25 @@ export class RemoteSettingsClient {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* sync
|
||||
*/
|
||||
sync() {
|
||||
const liftResult = (result) => undefined;
|
||||
const liftError = (data) => FfiConverterTypeRemoteSettingsError.lift(data);
|
||||
const functionCall = () => {
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
21, // remote_settings:uniffi_remote_settings_fn_method_remotesettingsclient_sync
|
||||
FfiConverterTypeRemoteSettingsClient.lower(this),
|
||||
)
|
||||
}
|
||||
try {
|
||||
return functionCall().then((result) => handleRustResult(result, liftResult, liftError));
|
||||
} catch (error) {
|
||||
return Promise.reject(error)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Export the FFIConverter object to make external types work.
|
||||
@@ -841,17 +860,13 @@ export class RemoteSettingsService {
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
24, // remote_settings:uniffi_remote_settings_fn_constructor_remotesettingsservice_new
|
||||
return UniFFIScaffolding.callSync(
|
||||
25, // remote_settings:uniffi_remote_settings_fn_constructor_remotesettingsservice_new
|
||||
FfiConverterString.lower(storageDir),
|
||||
FfiConverterTypeRemoteSettingsConfig2.lower(config),
|
||||
)
|
||||
}
|
||||
try {
|
||||
return functionCall().then((result) => handleRustResult(result, liftResult, liftError));
|
||||
} catch (error) {
|
||||
return Promise.reject(error)
|
||||
}}
|
||||
return handleRustResult(functionCall(), liftResult, liftError);}
|
||||
|
||||
/**
|
||||
* Create a new Remote Settings client
|
||||
@@ -870,7 +885,7 @@ export class RemoteSettingsService {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
21, // remote_settings:uniffi_remote_settings_fn_method_remotesettingsservice_make_client
|
||||
22, // remote_settings:uniffi_remote_settings_fn_method_remotesettingsservice_make_client
|
||||
FfiConverterTypeRemoteSettingsService.lower(this),
|
||||
FfiConverterString.lower(collectionName),
|
||||
)
|
||||
@@ -891,7 +906,7 @@ export class RemoteSettingsService {
|
||||
const liftError = (data) => FfiConverterTypeRemoteSettingsError.lift(data);
|
||||
const functionCall = () => {
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
22, // remote_settings:uniffi_remote_settings_fn_method_remotesettingsservice_sync
|
||||
23, // remote_settings:uniffi_remote_settings_fn_method_remotesettingsservice_sync
|
||||
FfiConverterTypeRemoteSettingsService.lower(this),
|
||||
)
|
||||
}
|
||||
@@ -924,7 +939,7 @@ export class RemoteSettingsService {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
23, // remote_settings:uniffi_remote_settings_fn_method_remotesettingsservice_update_config
|
||||
24, // remote_settings:uniffi_remote_settings_fn_method_remotesettingsservice_update_config
|
||||
FfiConverterTypeRemoteSettingsService.lower(this),
|
||||
FfiConverterTypeRemoteSettingsConfig2.lower(config),
|
||||
)
|
||||
|
||||
@@ -396,7 +396,7 @@ export class SearchEngineSelector {
|
||||
const liftError = null;
|
||||
const functionCall = () => {
|
||||
return UniFFIScaffolding.callSync(
|
||||
30, // search:uniffi_search_fn_constructor_searchengineselector_new
|
||||
31, // search:uniffi_search_fn_constructor_searchengineselector_new
|
||||
)
|
||||
}
|
||||
return handleRustResult(functionCall(), liftResult, liftError);}
|
||||
@@ -411,7 +411,7 @@ export class SearchEngineSelector {
|
||||
const liftError = null;
|
||||
const functionCall = () => {
|
||||
return UniFFIScaffolding.callSync(
|
||||
25, // search:uniffi_search_fn_method_searchengineselector_clear_search_config
|
||||
26, // search:uniffi_search_fn_method_searchengineselector_clear_search_config
|
||||
FfiConverterTypeSearchEngineSelector.lower(this),
|
||||
)
|
||||
}
|
||||
@@ -437,7 +437,7 @@ export class SearchEngineSelector {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callSync(
|
||||
26, // search:uniffi_search_fn_method_searchengineselector_filter_engine_configuration
|
||||
27, // search:uniffi_search_fn_method_searchengineselector_filter_engine_configuration
|
||||
FfiConverterTypeSearchEngineSelector.lower(this),
|
||||
FfiConverterTypeSearchUserEnvironment.lower(userEnvironment),
|
||||
)
|
||||
@@ -461,7 +461,7 @@ export class SearchEngineSelector {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callSync(
|
||||
27, // search:uniffi_search_fn_method_searchengineselector_set_config_overrides
|
||||
28, // search:uniffi_search_fn_method_searchengineselector_set_config_overrides
|
||||
FfiConverterTypeSearchEngineSelector.lower(this),
|
||||
FfiConverterString.lower(overrides),
|
||||
)
|
||||
@@ -489,7 +489,7 @@ export class SearchEngineSelector {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callSync(
|
||||
28, // search:uniffi_search_fn_method_searchengineselector_set_search_config
|
||||
29, // search:uniffi_search_fn_method_searchengineselector_set_search_config
|
||||
FfiConverterTypeSearchEngineSelector.lower(this),
|
||||
FfiConverterString.lower(configuration),
|
||||
)
|
||||
@@ -530,7 +530,7 @@ export class SearchEngineSelector {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
29, // search:uniffi_search_fn_method_searchengineselector_use_remote_settings_server
|
||||
30, // search:uniffi_search_fn_method_searchengineselector_use_remote_settings_server
|
||||
FfiConverterTypeSearchEngineSelector.lower(this),
|
||||
FfiConverterTypeRemoteSettingsService.lower(service),
|
||||
FfiConverterBool.lower(applyEngineOverrides),
|
||||
|
||||
@@ -530,7 +530,7 @@ export class SuggestStore {
|
||||
* Creates a Suggest store.
|
||||
* @returns {SuggestStore}
|
||||
*/
|
||||
static init(path,settingsConfig = null) {
|
||||
static init(path,remoteSettingsService) {
|
||||
const liftResult = (result) => FfiConverterTypeSuggestStore.lift(result);
|
||||
const liftError = (data) => FfiConverterTypeSuggestApiError.lift(data);
|
||||
const functionCall = () => {
|
||||
@@ -543,17 +543,17 @@ export class SuggestStore {
|
||||
throw e;
|
||||
}
|
||||
try {
|
||||
FfiConverterOptionalTypeRemoteSettingsConfig.checkType(settingsConfig)
|
||||
FfiConverterTypeRemoteSettingsService.checkType(remoteSettingsService)
|
||||
} catch (e) {
|
||||
if (e instanceof UniFFITypeError) {
|
||||
e.addItemDescriptionPart("settingsConfig");
|
||||
e.addItemDescriptionPart("remoteSettingsService");
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callSync(
|
||||
42, // suggest:uniffi_suggest_fn_constructor_suggeststore_new
|
||||
43, // suggest:uniffi_suggest_fn_constructor_suggeststore_new
|
||||
FfiConverterString.lower(path),
|
||||
FfiConverterOptionalTypeRemoteSettingsConfig.lower(settingsConfig),
|
||||
FfiConverterTypeRemoteSettingsService.lower(remoteSettingsService),
|
||||
)
|
||||
}
|
||||
return handleRustResult(functionCall(), liftResult, liftError);}
|
||||
@@ -566,7 +566,7 @@ export class SuggestStore {
|
||||
const liftError = (data) => FfiConverterTypeSuggestApiError.lift(data);
|
||||
const functionCall = () => {
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
32, // suggest:uniffi_suggest_fn_method_suggeststore_clear
|
||||
33, // suggest:uniffi_suggest_fn_method_suggeststore_clear
|
||||
FfiConverterTypeSuggestStore.lower(this),
|
||||
)
|
||||
}
|
||||
@@ -585,7 +585,7 @@ export class SuggestStore {
|
||||
const liftError = (data) => FfiConverterTypeSuggestApiError.lift(data);
|
||||
const functionCall = () => {
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
33, // suggest:uniffi_suggest_fn_method_suggeststore_clear_dismissed_suggestions
|
||||
34, // suggest:uniffi_suggest_fn_method_suggeststore_clear_dismissed_suggestions
|
||||
FfiConverterTypeSuggestStore.lower(this),
|
||||
)
|
||||
}
|
||||
@@ -616,7 +616,7 @@ export class SuggestStore {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
34, // suggest:uniffi_suggest_fn_method_suggeststore_dismiss_suggestion
|
||||
35, // suggest:uniffi_suggest_fn_method_suggeststore_dismiss_suggestion
|
||||
FfiConverterTypeSuggestStore.lower(this),
|
||||
FfiConverterString.lower(suggestionUrl),
|
||||
)
|
||||
@@ -691,7 +691,7 @@ export class SuggestStore {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
35, // suggest:uniffi_suggest_fn_method_suggeststore_fetch_geonames
|
||||
36, // suggest:uniffi_suggest_fn_method_suggeststore_fetch_geonames
|
||||
FfiConverterTypeSuggestStore.lower(this),
|
||||
FfiConverterString.lower(query),
|
||||
FfiConverterBool.lower(matchNamePrefix),
|
||||
@@ -715,7 +715,7 @@ export class SuggestStore {
|
||||
const liftError = (data) => FfiConverterTypeSuggestApiError.lift(data);
|
||||
const functionCall = () => {
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
36, // suggest:uniffi_suggest_fn_method_suggeststore_fetch_global_config
|
||||
37, // suggest:uniffi_suggest_fn_method_suggeststore_fetch_global_config
|
||||
FfiConverterTypeSuggestStore.lower(this),
|
||||
)
|
||||
}
|
||||
@@ -743,7 +743,7 @@ export class SuggestStore {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
37, // suggest:uniffi_suggest_fn_method_suggeststore_fetch_provider_config
|
||||
38, // suggest:uniffi_suggest_fn_method_suggeststore_fetch_provider_config
|
||||
FfiConverterTypeSuggestStore.lower(this),
|
||||
FfiConverterTypeSuggestionProvider.lower(provider),
|
||||
)
|
||||
@@ -772,7 +772,7 @@ export class SuggestStore {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
38, // suggest:uniffi_suggest_fn_method_suggeststore_ingest
|
||||
39, // suggest:uniffi_suggest_fn_method_suggeststore_ingest
|
||||
FfiConverterTypeSuggestStore.lower(this),
|
||||
FfiConverterTypeSuggestIngestionConstraints.lower(constraints),
|
||||
)
|
||||
@@ -804,7 +804,7 @@ export class SuggestStore {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callSync(
|
||||
39, // suggest:uniffi_suggest_fn_method_suggeststore_interrupt
|
||||
40, // suggest:uniffi_suggest_fn_method_suggeststore_interrupt
|
||||
FfiConverterTypeSuggestStore.lower(this),
|
||||
FfiConverterOptionalTypeInterruptKind.lower(kind),
|
||||
)
|
||||
@@ -829,7 +829,7 @@ export class SuggestStore {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
40, // suggest:uniffi_suggest_fn_method_suggeststore_query
|
||||
41, // suggest:uniffi_suggest_fn_method_suggeststore_query
|
||||
FfiConverterTypeSuggestStore.lower(this),
|
||||
FfiConverterTypeSuggestionQuery.lower(query),
|
||||
)
|
||||
@@ -858,7 +858,7 @@ export class SuggestStore {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
41, // suggest:uniffi_suggest_fn_method_suggeststore_query_with_metrics
|
||||
42, // suggest:uniffi_suggest_fn_method_suggeststore_query_with_metrics
|
||||
FfiConverterTypeSuggestStore.lower(this),
|
||||
FfiConverterTypeSuggestionQuery.lower(query),
|
||||
)
|
||||
@@ -929,7 +929,7 @@ export class SuggestStoreBuilder {
|
||||
const liftError = null;
|
||||
const functionCall = () => {
|
||||
return UniFFIScaffolding.callSync(
|
||||
50, // suggest:uniffi_suggest_fn_constructor_suggeststorebuilder_new
|
||||
51, // suggest:uniffi_suggest_fn_constructor_suggeststorebuilder_new
|
||||
)
|
||||
}
|
||||
return handleRustResult(functionCall(), liftResult, liftError);}
|
||||
@@ -943,7 +943,7 @@ export class SuggestStoreBuilder {
|
||||
const liftError = (data) => FfiConverterTypeSuggestApiError.lift(data);
|
||||
const functionCall = () => {
|
||||
return UniFFIScaffolding.callSync(
|
||||
43, // suggest:uniffi_suggest_fn_method_suggeststorebuilder_build
|
||||
44, // suggest:uniffi_suggest_fn_method_suggeststorebuilder_build
|
||||
FfiConverterTypeSuggestStoreBuilder.lower(this),
|
||||
)
|
||||
}
|
||||
@@ -967,7 +967,7 @@ export class SuggestStoreBuilder {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
44, // suggest:uniffi_suggest_fn_method_suggeststorebuilder_cache_path
|
||||
45, // suggest:uniffi_suggest_fn_method_suggeststorebuilder_cache_path
|
||||
FfiConverterTypeSuggestStoreBuilder.lower(this),
|
||||
FfiConverterString.lower(path),
|
||||
)
|
||||
@@ -996,7 +996,7 @@ export class SuggestStoreBuilder {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callSync(
|
||||
45, // suggest:uniffi_suggest_fn_method_suggeststorebuilder_data_path
|
||||
46, // suggest:uniffi_suggest_fn_method_suggeststorebuilder_data_path
|
||||
FfiConverterTypeSuggestStoreBuilder.lower(this),
|
||||
FfiConverterString.lower(path),
|
||||
)
|
||||
@@ -1033,7 +1033,7 @@ export class SuggestStoreBuilder {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callSync(
|
||||
46, // suggest:uniffi_suggest_fn_method_suggeststorebuilder_load_extension
|
||||
47, // suggest:uniffi_suggest_fn_method_suggeststorebuilder_load_extension
|
||||
FfiConverterTypeSuggestStoreBuilder.lower(this),
|
||||
FfiConverterString.lower(library),
|
||||
FfiConverterOptionalstring.lower(entryPoint),
|
||||
@@ -1059,7 +1059,7 @@ export class SuggestStoreBuilder {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callSync(
|
||||
47, // suggest:uniffi_suggest_fn_method_suggeststorebuilder_remote_settings_bucket_name
|
||||
48, // suggest:uniffi_suggest_fn_method_suggeststorebuilder_remote_settings_bucket_name
|
||||
FfiConverterTypeSuggestStoreBuilder.lower(this),
|
||||
FfiConverterString.lower(bucketName),
|
||||
)
|
||||
@@ -1084,7 +1084,7 @@ export class SuggestStoreBuilder {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callSync(
|
||||
48, // suggest:uniffi_suggest_fn_method_suggeststorebuilder_remote_settings_server
|
||||
49, // suggest:uniffi_suggest_fn_method_suggeststorebuilder_remote_settings_server
|
||||
FfiConverterTypeSuggestStoreBuilder.lower(this),
|
||||
FfiConverterTypeRemoteSettingsServer.lower(server),
|
||||
)
|
||||
@@ -1108,17 +1108,13 @@ export class SuggestStoreBuilder {
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
49, // suggest:uniffi_suggest_fn_method_suggeststorebuilder_remote_settings_service
|
||||
return UniFFIScaffolding.callSync(
|
||||
50, // suggest:uniffi_suggest_fn_method_suggeststorebuilder_remote_settings_service
|
||||
FfiConverterTypeSuggestStoreBuilder.lower(this),
|
||||
FfiConverterTypeRemoteSettingsService.lower(rsService),
|
||||
)
|
||||
}
|
||||
try {
|
||||
return functionCall().then((result) => handleRustResult(result, liftResult, liftError));
|
||||
} catch (error) {
|
||||
return Promise.reject(error)
|
||||
}
|
||||
return handleRustResult(functionCall(), liftResult, liftError);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -3208,18 +3204,14 @@ export const SuggestionProvider = {
|
||||
* WEATHER
|
||||
*/
|
||||
WEATHER: 7,
|
||||
/**
|
||||
* AMP_MOBILE
|
||||
*/
|
||||
AMP_MOBILE: 8,
|
||||
/**
|
||||
* FAKESPOT
|
||||
*/
|
||||
FAKESPOT: 9,
|
||||
FAKESPOT: 8,
|
||||
/**
|
||||
* EXPOSURE
|
||||
*/
|
||||
EXPOSURE: 10,
|
||||
EXPOSURE: 9,
|
||||
};
|
||||
|
||||
Object.freeze(SuggestionProvider);
|
||||
@@ -3242,10 +3234,8 @@ export class FfiConverterTypeSuggestionProvider extends FfiConverterArrayBuffer
|
||||
case 7:
|
||||
return SuggestionProvider.WEATHER
|
||||
case 8:
|
||||
return SuggestionProvider.AMP_MOBILE
|
||||
case 9:
|
||||
return SuggestionProvider.FAKESPOT
|
||||
case 10:
|
||||
case 9:
|
||||
return SuggestionProvider.EXPOSURE
|
||||
default:
|
||||
throw new UniFFITypeError("Unknown SuggestionProvider variant");
|
||||
@@ -3281,16 +3271,12 @@ export class FfiConverterTypeSuggestionProvider extends FfiConverterArrayBuffer
|
||||
dataStream.writeInt32(7);
|
||||
return;
|
||||
}
|
||||
if (value === SuggestionProvider.AMP_MOBILE) {
|
||||
if (value === SuggestionProvider.FAKESPOT) {
|
||||
dataStream.writeInt32(8);
|
||||
return;
|
||||
}
|
||||
if (value === SuggestionProvider.FAKESPOT) {
|
||||
dataStream.writeInt32(9);
|
||||
return;
|
||||
}
|
||||
if (value === SuggestionProvider.EXPOSURE) {
|
||||
dataStream.writeInt32(10);
|
||||
dataStream.writeInt32(9);
|
||||
return;
|
||||
}
|
||||
throw new UniFFITypeError("Unknown SuggestionProvider variant");
|
||||
@@ -3301,7 +3287,7 @@ export class FfiConverterTypeSuggestionProvider extends FfiConverterArrayBuffer
|
||||
}
|
||||
|
||||
static checkType(value) {
|
||||
if (!Number.isInteger(value) || value < 1 || value > 10) {
|
||||
if (!Number.isInteger(value) || value < 1 || value > 9) {
|
||||
throw new UniFFITypeError(`${value} is not a valid value for SuggestionProvider`);
|
||||
}
|
||||
}
|
||||
@@ -3789,43 +3775,6 @@ export class FfiConverterOptionalSequenceTypeSuggestionProvider extends FfiConve
|
||||
}
|
||||
}
|
||||
|
||||
// Export the FFIConverter object to make external types work.
|
||||
export class FfiConverterOptionalTypeRemoteSettingsConfig extends FfiConverterArrayBuffer {
|
||||
static checkType(value) {
|
||||
if (value !== undefined && value !== null) {
|
||||
FfiConverterTypeRemoteSettingsConfig.checkType(value)
|
||||
}
|
||||
}
|
||||
|
||||
static read(dataStream) {
|
||||
const code = dataStream.readUint8(0);
|
||||
switch (code) {
|
||||
case 0:
|
||||
return null
|
||||
case 1:
|
||||
return FfiConverterTypeRemoteSettingsConfig.read(dataStream)
|
||||
default:
|
||||
throw new UniFFIError(`Unexpected code: ${code}`);
|
||||
}
|
||||
}
|
||||
|
||||
static write(dataStream, value) {
|
||||
if (value === null || value === undefined) {
|
||||
dataStream.writeUint8(0);
|
||||
return;
|
||||
}
|
||||
dataStream.writeUint8(1);
|
||||
FfiConverterTypeRemoteSettingsConfig.write(dataStream, value)
|
||||
}
|
||||
|
||||
static computeSize(value) {
|
||||
if (value === null || value === undefined) {
|
||||
return 1;
|
||||
}
|
||||
return 1 + FfiConverterTypeRemoteSettingsConfig.computeSize(value)
|
||||
}
|
||||
}
|
||||
|
||||
// Export the FFIConverter object to make external types work.
|
||||
export class FfiConverterSequencestring extends FfiConverterArrayBuffer {
|
||||
static read(dataStream) {
|
||||
@@ -4090,14 +4039,6 @@ export class FfiConverterSequenceTypeSuggestionProvider extends FfiConverterArra
|
||||
}
|
||||
}
|
||||
|
||||
import {
|
||||
FfiConverterTypeRemoteSettingsConfig,
|
||||
RemoteSettingsConfig,
|
||||
} from "resource://gre/modules/RustRemoteSettings.sys.mjs";
|
||||
|
||||
// Export the FFIConverter object to make external types work.
|
||||
export { FfiConverterTypeRemoteSettingsConfig, RemoteSettingsConfig };
|
||||
|
||||
import {
|
||||
FfiConverterTypeRemoteSettingsServer,
|
||||
RemoteSettingsServer,
|
||||
@@ -4146,7 +4087,7 @@ export function rawSuggestionUrlMatches(rawUrl,cookedUrl) {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callSync(
|
||||
31, // suggest:uniffi_suggest_fn_func_raw_suggestion_url_matches
|
||||
32, // suggest:uniffi_suggest_fn_func_raw_suggestion_url_matches
|
||||
FfiConverterString.lower(rawUrl),
|
||||
FfiConverterString.lower(cookedUrl),
|
||||
)
|
||||
|
||||
@@ -448,7 +448,7 @@ export class RemoteCommandStore {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
51, // tabs:uniffi_tabs_fn_method_remotecommandstore_add_remote_command
|
||||
52, // tabs:uniffi_tabs_fn_method_remotecommandstore_add_remote_command
|
||||
FfiConverterTypeRemoteCommandStore.lower(this),
|
||||
FfiConverterString.lower(deviceId),
|
||||
FfiConverterTypeRemoteCommand.lower(command),
|
||||
@@ -494,7 +494,7 @@ export class RemoteCommandStore {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
52, // tabs:uniffi_tabs_fn_method_remotecommandstore_add_remote_command_at
|
||||
53, // tabs:uniffi_tabs_fn_method_remotecommandstore_add_remote_command_at
|
||||
FfiConverterTypeRemoteCommandStore.lower(this),
|
||||
FfiConverterString.lower(deviceId),
|
||||
FfiConverterTypeRemoteCommand.lower(command),
|
||||
@@ -517,7 +517,7 @@ export class RemoteCommandStore {
|
||||
const liftError = (data) => FfiConverterTypeTabsApiError.lift(data);
|
||||
const functionCall = () => {
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
53, // tabs:uniffi_tabs_fn_method_remotecommandstore_get_unsent_commands
|
||||
54, // tabs:uniffi_tabs_fn_method_remotecommandstore_get_unsent_commands
|
||||
FfiConverterTypeRemoteCommandStore.lower(this),
|
||||
)
|
||||
}
|
||||
@@ -554,7 +554,7 @@ export class RemoteCommandStore {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
54, // tabs:uniffi_tabs_fn_method_remotecommandstore_remove_remote_command
|
||||
55, // tabs:uniffi_tabs_fn_method_remotecommandstore_remove_remote_command
|
||||
FfiConverterTypeRemoteCommandStore.lower(this),
|
||||
FfiConverterString.lower(deviceId),
|
||||
FfiConverterTypeRemoteCommand.lower(command),
|
||||
@@ -584,7 +584,7 @@ export class RemoteCommandStore {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
55, // tabs:uniffi_tabs_fn_method_remotecommandstore_set_pending_command_sent
|
||||
56, // tabs:uniffi_tabs_fn_method_remotecommandstore_set_pending_command_sent
|
||||
FfiConverterTypeRemoteCommandStore.lower(this),
|
||||
FfiConverterTypePendingCommand.lower(command),
|
||||
)
|
||||
@@ -655,7 +655,7 @@ export class TabsBridgedEngine {
|
||||
const liftError = (data) => FfiConverterTypeTabsApiError.lift(data);
|
||||
const functionCall = () => {
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
56, // tabs:uniffi_tabs_fn_method_tabsbridgedengine_apply
|
||||
57, // tabs:uniffi_tabs_fn_method_tabsbridgedengine_apply
|
||||
FfiConverterTypeTabsBridgedEngine.lower(this),
|
||||
)
|
||||
}
|
||||
@@ -683,7 +683,7 @@ export class TabsBridgedEngine {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
57, // tabs:uniffi_tabs_fn_method_tabsbridgedengine_ensure_current_sync_id
|
||||
58, // tabs:uniffi_tabs_fn_method_tabsbridgedengine_ensure_current_sync_id
|
||||
FfiConverterTypeTabsBridgedEngine.lower(this),
|
||||
FfiConverterString.lower(newSyncId),
|
||||
)
|
||||
@@ -704,7 +704,7 @@ export class TabsBridgedEngine {
|
||||
const liftError = (data) => FfiConverterTypeTabsApiError.lift(data);
|
||||
const functionCall = () => {
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
58, // tabs:uniffi_tabs_fn_method_tabsbridgedengine_last_sync
|
||||
59, // tabs:uniffi_tabs_fn_method_tabsbridgedengine_last_sync
|
||||
FfiConverterTypeTabsBridgedEngine.lower(this),
|
||||
)
|
||||
}
|
||||
@@ -731,7 +731,7 @@ export class TabsBridgedEngine {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
59, // tabs:uniffi_tabs_fn_method_tabsbridgedengine_prepare_for_sync
|
||||
60, // tabs:uniffi_tabs_fn_method_tabsbridgedengine_prepare_for_sync
|
||||
FfiConverterTypeTabsBridgedEngine.lower(this),
|
||||
FfiConverterString.lower(clientData),
|
||||
)
|
||||
@@ -751,7 +751,7 @@ export class TabsBridgedEngine {
|
||||
const liftError = (data) => FfiConverterTypeTabsApiError.lift(data);
|
||||
const functionCall = () => {
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
60, // tabs:uniffi_tabs_fn_method_tabsbridgedengine_reset
|
||||
61, // tabs:uniffi_tabs_fn_method_tabsbridgedengine_reset
|
||||
FfiConverterTypeTabsBridgedEngine.lower(this),
|
||||
)
|
||||
}
|
||||
@@ -771,7 +771,7 @@ export class TabsBridgedEngine {
|
||||
const liftError = (data) => FfiConverterTypeTabsApiError.lift(data);
|
||||
const functionCall = () => {
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
61, // tabs:uniffi_tabs_fn_method_tabsbridgedengine_reset_sync_id
|
||||
62, // tabs:uniffi_tabs_fn_method_tabsbridgedengine_reset_sync_id
|
||||
FfiConverterTypeTabsBridgedEngine.lower(this),
|
||||
)
|
||||
}
|
||||
@@ -798,7 +798,7 @@ export class TabsBridgedEngine {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
62, // tabs:uniffi_tabs_fn_method_tabsbridgedengine_set_last_sync
|
||||
63, // tabs:uniffi_tabs_fn_method_tabsbridgedengine_set_last_sync
|
||||
FfiConverterTypeTabsBridgedEngine.lower(this),
|
||||
FfiConverterI64.lower(lastSync),
|
||||
)
|
||||
@@ -834,7 +834,7 @@ export class TabsBridgedEngine {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
63, // tabs:uniffi_tabs_fn_method_tabsbridgedengine_set_uploaded
|
||||
64, // tabs:uniffi_tabs_fn_method_tabsbridgedengine_set_uploaded
|
||||
FfiConverterTypeTabsBridgedEngine.lower(this),
|
||||
FfiConverterI64.lower(newTimestamp),
|
||||
FfiConverterSequenceTypeTabsGuid.lower(uploadedIds),
|
||||
@@ -863,7 +863,7 @@ export class TabsBridgedEngine {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
64, // tabs:uniffi_tabs_fn_method_tabsbridgedengine_store_incoming
|
||||
65, // tabs:uniffi_tabs_fn_method_tabsbridgedengine_store_incoming
|
||||
FfiConverterTypeTabsBridgedEngine.lower(this),
|
||||
FfiConverterSequencestring.lower(incomingEnvelopesAsJson),
|
||||
)
|
||||
@@ -883,7 +883,7 @@ export class TabsBridgedEngine {
|
||||
const liftError = (data) => FfiConverterTypeTabsApiError.lift(data);
|
||||
const functionCall = () => {
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
65, // tabs:uniffi_tabs_fn_method_tabsbridgedengine_sync_finished
|
||||
66, // tabs:uniffi_tabs_fn_method_tabsbridgedengine_sync_finished
|
||||
FfiConverterTypeTabsBridgedEngine.lower(this),
|
||||
)
|
||||
}
|
||||
@@ -903,7 +903,7 @@ export class TabsBridgedEngine {
|
||||
const liftError = (data) => FfiConverterTypeTabsApiError.lift(data);
|
||||
const functionCall = () => {
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
66, // tabs:uniffi_tabs_fn_method_tabsbridgedengine_sync_id
|
||||
67, // tabs:uniffi_tabs_fn_method_tabsbridgedengine_sync_id
|
||||
FfiConverterTypeTabsBridgedEngine.lower(this),
|
||||
)
|
||||
}
|
||||
@@ -922,7 +922,7 @@ export class TabsBridgedEngine {
|
||||
const liftError = (data) => FfiConverterTypeTabsApiError.lift(data);
|
||||
const functionCall = () => {
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
67, // tabs:uniffi_tabs_fn_method_tabsbridgedengine_sync_started
|
||||
68, // tabs:uniffi_tabs_fn_method_tabsbridgedengine_sync_started
|
||||
FfiConverterTypeTabsBridgedEngine.lower(this),
|
||||
)
|
||||
}
|
||||
@@ -941,7 +941,7 @@ export class TabsBridgedEngine {
|
||||
const liftError = (data) => FfiConverterTypeTabsApiError.lift(data);
|
||||
const functionCall = () => {
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
68, // tabs:uniffi_tabs_fn_method_tabsbridgedengine_wipe
|
||||
69, // tabs:uniffi_tabs_fn_method_tabsbridgedengine_wipe
|
||||
FfiConverterTypeTabsBridgedEngine.lower(this),
|
||||
)
|
||||
}
|
||||
@@ -1016,7 +1016,7 @@ export class TabsStore {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
75, // tabs:uniffi_tabs_fn_constructor_tabsstore_new
|
||||
76, // tabs:uniffi_tabs_fn_constructor_tabsstore_new
|
||||
FfiConverterString.lower(path),
|
||||
)
|
||||
}
|
||||
@@ -1035,7 +1035,7 @@ export class TabsStore {
|
||||
const liftError = null;
|
||||
const functionCall = () => {
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
69, // tabs:uniffi_tabs_fn_method_tabsstore_bridged_engine
|
||||
70, // tabs:uniffi_tabs_fn_method_tabsstore_bridged_engine
|
||||
FfiConverterTypeTabsStore.lower(this),
|
||||
)
|
||||
}
|
||||
@@ -1054,7 +1054,7 @@ export class TabsStore {
|
||||
const liftError = null;
|
||||
const functionCall = () => {
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
70, // tabs:uniffi_tabs_fn_method_tabsstore_close_connection
|
||||
71, // tabs:uniffi_tabs_fn_method_tabsstore_close_connection
|
||||
FfiConverterTypeTabsStore.lower(this),
|
||||
)
|
||||
}
|
||||
@@ -1074,7 +1074,7 @@ export class TabsStore {
|
||||
const liftError = null;
|
||||
const functionCall = () => {
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
71, // tabs:uniffi_tabs_fn_method_tabsstore_get_all
|
||||
72, // tabs:uniffi_tabs_fn_method_tabsstore_get_all
|
||||
FfiConverterTypeTabsStore.lower(this),
|
||||
)
|
||||
}
|
||||
@@ -1094,7 +1094,7 @@ export class TabsStore {
|
||||
const liftError = null;
|
||||
const functionCall = () => {
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
72, // tabs:uniffi_tabs_fn_method_tabsstore_new_remote_command_store
|
||||
73, // tabs:uniffi_tabs_fn_method_tabsstore_new_remote_command_store
|
||||
FfiConverterTypeTabsStore.lower(this),
|
||||
)
|
||||
}
|
||||
@@ -1113,7 +1113,7 @@ export class TabsStore {
|
||||
const liftError = null;
|
||||
const functionCall = () => {
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
73, // tabs:uniffi_tabs_fn_method_tabsstore_register_with_sync_manager
|
||||
74, // tabs:uniffi_tabs_fn_method_tabsstore_register_with_sync_manager
|
||||
FfiConverterTypeTabsStore.lower(this),
|
||||
)
|
||||
}
|
||||
@@ -1140,7 +1140,7 @@ export class TabsStore {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
74, // tabs:uniffi_tabs_fn_method_tabsstore_set_local_tabs
|
||||
75, // tabs:uniffi_tabs_fn_method_tabsstore_set_local_tabs
|
||||
FfiConverterTypeTabsStore.lower(this),
|
||||
FfiConverterSequenceTypeRemoteTabRecord.lower(remoteTabs),
|
||||
)
|
||||
|
||||
@@ -417,7 +417,7 @@ export class WebExtStorageBridgedEngine {
|
||||
const liftError = (data) => FfiConverterTypeWebExtStorageApiError.lift(data);
|
||||
const functionCall = () => {
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
76, // webextstorage:uniffi_webext_storage_fn_method_webextstoragebridgedengine_apply
|
||||
77, // webextstorage:uniffi_webext_storage_fn_method_webextstoragebridgedengine_apply
|
||||
FfiConverterTypeWebExtStorageBridgedEngine.lower(this),
|
||||
)
|
||||
}
|
||||
@@ -445,7 +445,7 @@ export class WebExtStorageBridgedEngine {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
77, // webextstorage:uniffi_webext_storage_fn_method_webextstoragebridgedengine_ensure_current_sync_id
|
||||
78, // webextstorage:uniffi_webext_storage_fn_method_webextstoragebridgedengine_ensure_current_sync_id
|
||||
FfiConverterTypeWebExtStorageBridgedEngine.lower(this),
|
||||
FfiConverterString.lower(newSyncId),
|
||||
)
|
||||
@@ -466,7 +466,7 @@ export class WebExtStorageBridgedEngine {
|
||||
const liftError = (data) => FfiConverterTypeWebExtStorageApiError.lift(data);
|
||||
const functionCall = () => {
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
78, // webextstorage:uniffi_webext_storage_fn_method_webextstoragebridgedengine_last_sync
|
||||
79, // webextstorage:uniffi_webext_storage_fn_method_webextstoragebridgedengine_last_sync
|
||||
FfiConverterTypeWebExtStorageBridgedEngine.lower(this),
|
||||
)
|
||||
}
|
||||
@@ -493,7 +493,7 @@ export class WebExtStorageBridgedEngine {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
79, // webextstorage:uniffi_webext_storage_fn_method_webextstoragebridgedengine_prepare_for_sync
|
||||
80, // webextstorage:uniffi_webext_storage_fn_method_webextstoragebridgedengine_prepare_for_sync
|
||||
FfiConverterTypeWebExtStorageBridgedEngine.lower(this),
|
||||
FfiConverterString.lower(clientData),
|
||||
)
|
||||
@@ -513,7 +513,7 @@ export class WebExtStorageBridgedEngine {
|
||||
const liftError = (data) => FfiConverterTypeWebExtStorageApiError.lift(data);
|
||||
const functionCall = () => {
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
80, // webextstorage:uniffi_webext_storage_fn_method_webextstoragebridgedengine_reset
|
||||
81, // webextstorage:uniffi_webext_storage_fn_method_webextstoragebridgedengine_reset
|
||||
FfiConverterTypeWebExtStorageBridgedEngine.lower(this),
|
||||
)
|
||||
}
|
||||
@@ -533,7 +533,7 @@ export class WebExtStorageBridgedEngine {
|
||||
const liftError = (data) => FfiConverterTypeWebExtStorageApiError.lift(data);
|
||||
const functionCall = () => {
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
81, // webextstorage:uniffi_webext_storage_fn_method_webextstoragebridgedengine_reset_sync_id
|
||||
82, // webextstorage:uniffi_webext_storage_fn_method_webextstoragebridgedengine_reset_sync_id
|
||||
FfiConverterTypeWebExtStorageBridgedEngine.lower(this),
|
||||
)
|
||||
}
|
||||
@@ -560,7 +560,7 @@ export class WebExtStorageBridgedEngine {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
82, // webextstorage:uniffi_webext_storage_fn_method_webextstoragebridgedengine_set_last_sync
|
||||
83, // webextstorage:uniffi_webext_storage_fn_method_webextstoragebridgedengine_set_last_sync
|
||||
FfiConverterTypeWebExtStorageBridgedEngine.lower(this),
|
||||
FfiConverterI64.lower(lastSync),
|
||||
)
|
||||
@@ -596,7 +596,7 @@ export class WebExtStorageBridgedEngine {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
83, // webextstorage:uniffi_webext_storage_fn_method_webextstoragebridgedengine_set_uploaded
|
||||
84, // webextstorage:uniffi_webext_storage_fn_method_webextstoragebridgedengine_set_uploaded
|
||||
FfiConverterTypeWebExtStorageBridgedEngine.lower(this),
|
||||
FfiConverterI64.lower(serverModifiedMillis),
|
||||
FfiConverterSequenceTypeGuid.lower(guids),
|
||||
@@ -625,7 +625,7 @@ export class WebExtStorageBridgedEngine {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
84, // webextstorage:uniffi_webext_storage_fn_method_webextstoragebridgedengine_store_incoming
|
||||
85, // webextstorage:uniffi_webext_storage_fn_method_webextstoragebridgedengine_store_incoming
|
||||
FfiConverterTypeWebExtStorageBridgedEngine.lower(this),
|
||||
FfiConverterSequencestring.lower(incoming),
|
||||
)
|
||||
@@ -645,7 +645,7 @@ export class WebExtStorageBridgedEngine {
|
||||
const liftError = (data) => FfiConverterTypeWebExtStorageApiError.lift(data);
|
||||
const functionCall = () => {
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
85, // webextstorage:uniffi_webext_storage_fn_method_webextstoragebridgedengine_sync_finished
|
||||
86, // webextstorage:uniffi_webext_storage_fn_method_webextstoragebridgedengine_sync_finished
|
||||
FfiConverterTypeWebExtStorageBridgedEngine.lower(this),
|
||||
)
|
||||
}
|
||||
@@ -665,7 +665,7 @@ export class WebExtStorageBridgedEngine {
|
||||
const liftError = (data) => FfiConverterTypeWebExtStorageApiError.lift(data);
|
||||
const functionCall = () => {
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
86, // webextstorage:uniffi_webext_storage_fn_method_webextstoragebridgedengine_sync_id
|
||||
87, // webextstorage:uniffi_webext_storage_fn_method_webextstoragebridgedengine_sync_id
|
||||
FfiConverterTypeWebExtStorageBridgedEngine.lower(this),
|
||||
)
|
||||
}
|
||||
@@ -684,7 +684,7 @@ export class WebExtStorageBridgedEngine {
|
||||
const liftError = (data) => FfiConverterTypeWebExtStorageApiError.lift(data);
|
||||
const functionCall = () => {
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
87, // webextstorage:uniffi_webext_storage_fn_method_webextstoragebridgedengine_sync_started
|
||||
88, // webextstorage:uniffi_webext_storage_fn_method_webextstoragebridgedengine_sync_started
|
||||
FfiConverterTypeWebExtStorageBridgedEngine.lower(this),
|
||||
)
|
||||
}
|
||||
@@ -703,7 +703,7 @@ export class WebExtStorageBridgedEngine {
|
||||
const liftError = (data) => FfiConverterTypeWebExtStorageApiError.lift(data);
|
||||
const functionCall = () => {
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
88, // webextstorage:uniffi_webext_storage_fn_method_webextstoragebridgedengine_wipe
|
||||
89, // webextstorage:uniffi_webext_storage_fn_method_webextstoragebridgedengine_wipe
|
||||
FfiConverterTypeWebExtStorageBridgedEngine.lower(this),
|
||||
)
|
||||
}
|
||||
@@ -778,7 +778,7 @@ export class WebExtStorageStore {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
97, // webextstorage:uniffi_webext_storage_fn_constructor_webextstoragestore_new
|
||||
98, // webextstorage:uniffi_webext_storage_fn_constructor_webextstoragestore_new
|
||||
FfiConverterString.lower(path),
|
||||
)
|
||||
}
|
||||
@@ -797,7 +797,7 @@ export class WebExtStorageStore {
|
||||
const liftError = null;
|
||||
const functionCall = () => {
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
89, // webextstorage:uniffi_webext_storage_fn_method_webextstoragestore_bridged_engine
|
||||
90, // webextstorage:uniffi_webext_storage_fn_method_webextstoragestore_bridged_engine
|
||||
FfiConverterTypeWebExtStorageStore.lower(this),
|
||||
)
|
||||
}
|
||||
@@ -825,7 +825,7 @@ export class WebExtStorageStore {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
90, // webextstorage:uniffi_webext_storage_fn_method_webextstoragestore_clear
|
||||
91, // webextstorage:uniffi_webext_storage_fn_method_webextstoragestore_clear
|
||||
FfiConverterTypeWebExtStorageStore.lower(this),
|
||||
FfiConverterString.lower(extId),
|
||||
)
|
||||
@@ -845,7 +845,7 @@ export class WebExtStorageStore {
|
||||
const liftError = (data) => FfiConverterTypeWebExtStorageApiError.lift(data);
|
||||
const functionCall = () => {
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
91, // webextstorage:uniffi_webext_storage_fn_method_webextstoragestore_close
|
||||
92, // webextstorage:uniffi_webext_storage_fn_method_webextstoragestore_close
|
||||
FfiConverterTypeWebExtStorageStore.lower(this),
|
||||
)
|
||||
}
|
||||
@@ -881,7 +881,7 @@ export class WebExtStorageStore {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
92, // webextstorage:uniffi_webext_storage_fn_method_webextstoragestore_get
|
||||
93, // webextstorage:uniffi_webext_storage_fn_method_webextstoragestore_get
|
||||
FfiConverterTypeWebExtStorageStore.lower(this),
|
||||
FfiConverterString.lower(extId),
|
||||
FfiConverterTypeJsonValue.lower(keys),
|
||||
@@ -919,7 +919,7 @@ export class WebExtStorageStore {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
93, // webextstorage:uniffi_webext_storage_fn_method_webextstoragestore_get_bytes_in_use
|
||||
94, // webextstorage:uniffi_webext_storage_fn_method_webextstoragestore_get_bytes_in_use
|
||||
FfiConverterTypeWebExtStorageStore.lower(this),
|
||||
FfiConverterString.lower(extId),
|
||||
FfiConverterTypeJsonValue.lower(keys),
|
||||
@@ -941,7 +941,7 @@ export class WebExtStorageStore {
|
||||
const liftError = (data) => FfiConverterTypeWebExtStorageApiError.lift(data);
|
||||
const functionCall = () => {
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
94, // webextstorage:uniffi_webext_storage_fn_method_webextstoragestore_get_synced_changes
|
||||
95, // webextstorage:uniffi_webext_storage_fn_method_webextstoragestore_get_synced_changes
|
||||
FfiConverterTypeWebExtStorageStore.lower(this),
|
||||
)
|
||||
}
|
||||
@@ -977,7 +977,7 @@ export class WebExtStorageStore {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
95, // webextstorage:uniffi_webext_storage_fn_method_webextstoragestore_remove
|
||||
96, // webextstorage:uniffi_webext_storage_fn_method_webextstoragestore_remove
|
||||
FfiConverterTypeWebExtStorageStore.lower(this),
|
||||
FfiConverterString.lower(extId),
|
||||
FfiConverterTypeJsonValue.lower(keys),
|
||||
@@ -1015,7 +1015,7 @@ export class WebExtStorageStore {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
96, // webextstorage:uniffi_webext_storage_fn_method_webextstoragestore_set
|
||||
97, // webextstorage:uniffi_webext_storage_fn_method_webextstoragestore_set
|
||||
FfiConverterTypeWebExtStorageStore.lower(this),
|
||||
FfiConverterString.lower(extId),
|
||||
FfiConverterTypeJsonValue.lower(val),
|
||||
|
||||
@@ -34,6 +34,7 @@ main_thread = [
|
||||
"SuggestStoreBuilder.load_extension",
|
||||
"SuggestStoreBuilder.remote_settings_bucket_name",
|
||||
"SuggestStoreBuilder.remote_settings_server",
|
||||
"SuggestStoreBuilder.remote_settings_service",
|
||||
"SuggestStoreBuilder.build",
|
||||
]
|
||||
|
||||
@@ -54,6 +55,7 @@ enable = true
|
||||
# These are exceptions to the async wrapping. These functions must not be `await`ed.
|
||||
main_thread = [
|
||||
"RemoteSettings.new",
|
||||
"RemoteSettingsService.new",
|
||||
]
|
||||
|
||||
[error_support.async_wrappers]
|
||||
|
||||
@@ -431,7 +431,7 @@ export function add(a,b) {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
98, // arithmetic:uniffi_arithmetical_fn_func_add
|
||||
99, // arithmetic:uniffi_arithmetical_fn_func_add
|
||||
FfiConverterU64.lower(a),
|
||||
FfiConverterU64.lower(b),
|
||||
)
|
||||
@@ -469,7 +469,7 @@ export function div(dividend,divisor) {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
99, // arithmetic:uniffi_arithmetical_fn_func_div
|
||||
100, // arithmetic:uniffi_arithmetical_fn_func_div
|
||||
FfiConverterU64.lower(dividend),
|
||||
FfiConverterU64.lower(divisor),
|
||||
)
|
||||
@@ -507,7 +507,7 @@ export function equal(a,b) {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
100, // arithmetic:uniffi_arithmetical_fn_func_equal
|
||||
101, // arithmetic:uniffi_arithmetical_fn_func_equal
|
||||
FfiConverterU64.lower(a),
|
||||
FfiConverterU64.lower(b),
|
||||
)
|
||||
@@ -545,7 +545,7 @@ export function sub(a,b) {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
101, // arithmetic:uniffi_arithmetical_fn_func_sub
|
||||
102, // arithmetic:uniffi_arithmetical_fn_func_sub
|
||||
FfiConverterU64.lower(a),
|
||||
FfiConverterU64.lower(b),
|
||||
)
|
||||
|
||||
@@ -513,7 +513,7 @@ export function getCustomTypesDemo(demo) {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
102, // custom_types:uniffi_uniffi_custom_types_fn_func_get_custom_types_demo
|
||||
103, // custom_types:uniffi_uniffi_custom_types_fn_func_get_custom_types_demo
|
||||
FfiConverterOptionalTypeCustomTypesDemo.lower(demo),
|
||||
)
|
||||
}
|
||||
|
||||
@@ -437,7 +437,7 @@ export function gradient(value) {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
103, // external_types:uniffi_uniffi_fixture_external_types_fn_func_gradient
|
||||
104, // external_types:uniffi_uniffi_fixture_external_types_fn_func_gradient
|
||||
FfiConverterOptionalTypeLine.lower(value),
|
||||
)
|
||||
}
|
||||
@@ -474,7 +474,7 @@ export function intersection(ln1,ln2) {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
104, // external_types:uniffi_uniffi_fixture_external_types_fn_func_intersection
|
||||
105, // external_types:uniffi_uniffi_fixture_external_types_fn_func_intersection
|
||||
FfiConverterTypeLine.lower(ln1),
|
||||
FfiConverterTypeLine.lower(ln2),
|
||||
)
|
||||
@@ -503,7 +503,7 @@ export function moveSpriteToOrigin(sprite) {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
105, // external_types:uniffi_uniffi_fixture_external_types_fn_func_move_sprite_to_origin
|
||||
106, // external_types:uniffi_uniffi_fixture_external_types_fn_func_move_sprite_to_origin
|
||||
FfiConverterTypeSprite.lower(sprite),
|
||||
)
|
||||
}
|
||||
|
||||
@@ -737,7 +737,7 @@ export function callLogRepeat(logger,message,count,exclude) {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
106, // fixture_callbacks:uniffi_uniffi_fixture_callbacks_fn_func_call_log_repeat
|
||||
107, // fixture_callbacks:uniffi_uniffi_fixture_callbacks_fn_func_call_log_repeat
|
||||
FfiConverterTypeLogger.lower(logger),
|
||||
FfiConverterString.lower(message),
|
||||
FfiConverterU32.lower(count),
|
||||
@@ -776,7 +776,7 @@ export function logEvenNumbers(logger,items) {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
107, // fixture_callbacks:uniffi_uniffi_fixture_callbacks_fn_func_log_even_numbers
|
||||
108, // fixture_callbacks:uniffi_uniffi_fixture_callbacks_fn_func_log_even_numbers
|
||||
FfiConverterTypeLogger.lower(logger),
|
||||
FfiConverterSequencei32.lower(items),
|
||||
)
|
||||
@@ -813,7 +813,7 @@ export function logEvenNumbersMainThread(logger,items) {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callSync(
|
||||
108, // fixture_callbacks:uniffi_uniffi_fixture_callbacks_fn_func_log_even_numbers_main_thread
|
||||
109, // fixture_callbacks:uniffi_uniffi_fixture_callbacks_fn_func_log_even_numbers_main_thread
|
||||
FfiConverterTypeLogger.lower(logger),
|
||||
FfiConverterSequencei32.lower(items),
|
||||
)
|
||||
|
||||
@@ -662,7 +662,7 @@ export class FutureTester {
|
||||
const liftError = null;
|
||||
const functionCall = () => {
|
||||
return UniFFIScaffolding.callSync(
|
||||
129, // futures:uniffi_uniffi_fixture_futures_fn_constructor_futuretester_init
|
||||
130, // futures:uniffi_uniffi_fixture_futures_fn_constructor_futuretester_init
|
||||
)
|
||||
}
|
||||
return handleRustResult(functionCall(), liftResult, liftError);}
|
||||
@@ -687,7 +687,7 @@ export class FutureTester {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callSync(
|
||||
126, // futures:uniffi_uniffi_fixture_futures_fn_method_futuretester_complete_futures
|
||||
127, // futures:uniffi_uniffi_fixture_futures_fn_method_futuretester_complete_futures
|
||||
FfiConverterTypeFutureTester.lower(this),
|
||||
FfiConverterU8.lower(value),
|
||||
)
|
||||
@@ -704,7 +704,7 @@ export class FutureTester {
|
||||
const liftError = null;
|
||||
const functionCall = () => {
|
||||
return UniFFIScaffolding.callAsync(
|
||||
127, // futures:uniffi_uniffi_fixture_futures_fn_method_futuretester_make_future
|
||||
128, // futures:uniffi_uniffi_fixture_futures_fn_method_futuretester_make_future
|
||||
FfiConverterTypeFutureTester.lower(this),
|
||||
)
|
||||
}
|
||||
@@ -724,7 +724,7 @@ export class FutureTester {
|
||||
const liftError = null;
|
||||
const functionCall = () => {
|
||||
return UniFFIScaffolding.callSync(
|
||||
128, // futures:uniffi_uniffi_fixture_futures_fn_method_futuretester_wake_futures
|
||||
129, // futures:uniffi_uniffi_fixture_futures_fn_method_futuretester_wake_futures
|
||||
FfiConverterTypeFutureTester.lower(this),
|
||||
)
|
||||
}
|
||||
@@ -787,7 +787,7 @@ export class RustTask {
|
||||
const liftError = null;
|
||||
const functionCall = () => {
|
||||
return UniFFIScaffolding.callSync(
|
||||
130, // futures:uniffi_uniffi_fixture_futures_fn_method_rusttask_run
|
||||
131, // futures:uniffi_uniffi_fixture_futures_fn_method_rusttask_run
|
||||
FfiConverterTypeRustTask.lower(this),
|
||||
)
|
||||
}
|
||||
@@ -858,7 +858,7 @@ export class Traveller {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callSync(
|
||||
132, // futures:uniffi_uniffi_fixture_futures_fn_constructor_traveller_new
|
||||
133, // futures:uniffi_uniffi_fixture_futures_fn_constructor_traveller_new
|
||||
FfiConverterString.lower(name),
|
||||
)
|
||||
}
|
||||
@@ -873,7 +873,7 @@ export class Traveller {
|
||||
const liftError = null;
|
||||
const functionCall = () => {
|
||||
return UniFFIScaffolding.callSync(
|
||||
131, // futures:uniffi_uniffi_fixture_futures_fn_method_traveller_name
|
||||
132, // futures:uniffi_uniffi_fixture_futures_fn_method_traveller_name
|
||||
FfiConverterTypeTraveller.lower(this),
|
||||
)
|
||||
}
|
||||
@@ -950,7 +950,7 @@ export class WorkerQueue {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callSync(
|
||||
133, // futures:uniffi_uniffi_fixture_futures_fn_method_workerqueue_add_task
|
||||
134, // futures:uniffi_uniffi_fixture_futures_fn_method_workerqueue_add_task
|
||||
FfiConverterTypeWorkerQueue.lower(this),
|
||||
FfiConverterTypeRustTask.lower(task),
|
||||
)
|
||||
@@ -1104,7 +1104,7 @@ export function expensiveComputation() {
|
||||
const liftError = null;
|
||||
const functionCall = () => {
|
||||
return UniFFIScaffolding.callAsync(
|
||||
109, // futures:uniffi_uniffi_fixture_futures_fn_func_expensive_computation
|
||||
110, // futures:uniffi_uniffi_fixture_futures_fn_func_expensive_computation
|
||||
)
|
||||
}
|
||||
try {
|
||||
@@ -1127,7 +1127,7 @@ export function initializeGeckoGlobalWorkerQueue() {
|
||||
const liftError = null;
|
||||
const functionCall = () => {
|
||||
return UniFFIScaffolding.callSync(
|
||||
110, // futures:uniffi_uniffi_fixture_futures_fn_func_initialize_gecko_global_worker_queue
|
||||
111, // futures:uniffi_uniffi_fixture_futures_fn_func_initialize_gecko_global_worker_queue
|
||||
)
|
||||
}
|
||||
return handleRustResult(functionCall(), liftResult, liftError);
|
||||
@@ -1151,7 +1151,7 @@ export function initializeGlobalWorkerQueue(workerQueue) {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callSync(
|
||||
111, // futures:uniffi_uniffi_fixture_futures_fn_func_initialize_global_worker_queue
|
||||
112, // futures:uniffi_uniffi_fixture_futures_fn_func_initialize_global_worker_queue
|
||||
FfiConverterTypeWorkerQueue.lower(workerQueue),
|
||||
)
|
||||
}
|
||||
@@ -1176,7 +1176,7 @@ export function roundtripF32(v) {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsync(
|
||||
112, // futures:uniffi_uniffi_fixture_futures_fn_func_roundtrip_f32
|
||||
113, // futures:uniffi_uniffi_fixture_futures_fn_func_roundtrip_f32
|
||||
FfiConverterF32.lower(v),
|
||||
)
|
||||
}
|
||||
@@ -1205,7 +1205,7 @@ export function roundtripF64(v) {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsync(
|
||||
113, // futures:uniffi_uniffi_fixture_futures_fn_func_roundtrip_f64
|
||||
114, // futures:uniffi_uniffi_fixture_futures_fn_func_roundtrip_f64
|
||||
FfiConverterF64.lower(v),
|
||||
)
|
||||
}
|
||||
@@ -1234,7 +1234,7 @@ export function roundtripI16(v) {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsync(
|
||||
114, // futures:uniffi_uniffi_fixture_futures_fn_func_roundtrip_i16
|
||||
115, // futures:uniffi_uniffi_fixture_futures_fn_func_roundtrip_i16
|
||||
FfiConverterI16.lower(v),
|
||||
)
|
||||
}
|
||||
@@ -1263,7 +1263,7 @@ export function roundtripI32(v) {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsync(
|
||||
115, // futures:uniffi_uniffi_fixture_futures_fn_func_roundtrip_i32
|
||||
116, // futures:uniffi_uniffi_fixture_futures_fn_func_roundtrip_i32
|
||||
FfiConverterI32.lower(v),
|
||||
)
|
||||
}
|
||||
@@ -1292,7 +1292,7 @@ export function roundtripI64(v) {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsync(
|
||||
116, // futures:uniffi_uniffi_fixture_futures_fn_func_roundtrip_i64
|
||||
117, // futures:uniffi_uniffi_fixture_futures_fn_func_roundtrip_i64
|
||||
FfiConverterI64.lower(v),
|
||||
)
|
||||
}
|
||||
@@ -1321,7 +1321,7 @@ export function roundtripI8(v) {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsync(
|
||||
117, // futures:uniffi_uniffi_fixture_futures_fn_func_roundtrip_i8
|
||||
118, // futures:uniffi_uniffi_fixture_futures_fn_func_roundtrip_i8
|
||||
FfiConverterI8.lower(v),
|
||||
)
|
||||
}
|
||||
@@ -1350,7 +1350,7 @@ export function roundtripMap(v) {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsync(
|
||||
118, // futures:uniffi_uniffi_fixture_futures_fn_func_roundtrip_map
|
||||
119, // futures:uniffi_uniffi_fixture_futures_fn_func_roundtrip_map
|
||||
FfiConverterMapStringString.lower(v),
|
||||
)
|
||||
}
|
||||
@@ -1379,7 +1379,7 @@ export function roundtripObj(v) {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsync(
|
||||
119, // futures:uniffi_uniffi_fixture_futures_fn_func_roundtrip_obj
|
||||
120, // futures:uniffi_uniffi_fixture_futures_fn_func_roundtrip_obj
|
||||
FfiConverterTypeTraveller.lower(v),
|
||||
)
|
||||
}
|
||||
@@ -1408,7 +1408,7 @@ export function roundtripString(v) {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsync(
|
||||
120, // futures:uniffi_uniffi_fixture_futures_fn_func_roundtrip_string
|
||||
121, // futures:uniffi_uniffi_fixture_futures_fn_func_roundtrip_string
|
||||
FfiConverterString.lower(v),
|
||||
)
|
||||
}
|
||||
@@ -1437,7 +1437,7 @@ export function roundtripU16(v) {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsync(
|
||||
121, // futures:uniffi_uniffi_fixture_futures_fn_func_roundtrip_u16
|
||||
122, // futures:uniffi_uniffi_fixture_futures_fn_func_roundtrip_u16
|
||||
FfiConverterU16.lower(v),
|
||||
)
|
||||
}
|
||||
@@ -1466,7 +1466,7 @@ export function roundtripU32(v) {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsync(
|
||||
122, // futures:uniffi_uniffi_fixture_futures_fn_func_roundtrip_u32
|
||||
123, // futures:uniffi_uniffi_fixture_futures_fn_func_roundtrip_u32
|
||||
FfiConverterU32.lower(v),
|
||||
)
|
||||
}
|
||||
@@ -1495,7 +1495,7 @@ export function roundtripU64(v) {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsync(
|
||||
123, // futures:uniffi_uniffi_fixture_futures_fn_func_roundtrip_u64
|
||||
124, // futures:uniffi_uniffi_fixture_futures_fn_func_roundtrip_u64
|
||||
FfiConverterU64.lower(v),
|
||||
)
|
||||
}
|
||||
@@ -1524,7 +1524,7 @@ export function roundtripU8(v) {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsync(
|
||||
124, // futures:uniffi_uniffi_fixture_futures_fn_func_roundtrip_u8
|
||||
125, // futures:uniffi_uniffi_fixture_futures_fn_func_roundtrip_u8
|
||||
FfiConverterU8.lower(v),
|
||||
)
|
||||
}
|
||||
@@ -1553,7 +1553,7 @@ export function roundtripVec(v) {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsync(
|
||||
125, // futures:uniffi_uniffi_fixture_futures_fn_func_roundtrip_vec
|
||||
126, // futures:uniffi_uniffi_fixture_futures_fn_func_roundtrip_vec
|
||||
FfiConverterSequenceu32.lower(v),
|
||||
)
|
||||
}
|
||||
|
||||
@@ -542,7 +542,7 @@ export function gradient(ln) {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
134, // geometry:uniffi_uniffi_geometry_fn_func_gradient
|
||||
135, // geometry:uniffi_uniffi_geometry_fn_func_gradient
|
||||
FfiConverterTypeLine.lower(ln),
|
||||
)
|
||||
}
|
||||
@@ -579,7 +579,7 @@ export function intersection(ln1,ln2) {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
135, // geometry:uniffi_uniffi_geometry_fn_func_intersection
|
||||
136, // geometry:uniffi_uniffi_geometry_fn_func_intersection
|
||||
FfiConverterTypeLine.lower(ln1),
|
||||
FfiConverterTypeLine.lower(ln2),
|
||||
)
|
||||
|
||||
@@ -371,7 +371,7 @@ export class SingletonObject {
|
||||
const liftError = null;
|
||||
const functionCall = () => {
|
||||
return UniFFIScaffolding.callSync(
|
||||
138, // refcounts:uniffi_uniffi_fixture_refcounts_fn_method_singletonobject_method
|
||||
139, // refcounts:uniffi_uniffi_fixture_refcounts_fn_method_singletonobject_method
|
||||
FfiConverterTypeSingletonObject.lower(this),
|
||||
)
|
||||
}
|
||||
@@ -423,7 +423,7 @@ export function getJsRefcount() {
|
||||
const liftError = null;
|
||||
const functionCall = () => {
|
||||
return UniFFIScaffolding.callSync(
|
||||
136, // refcounts:uniffi_uniffi_fixture_refcounts_fn_func_get_js_refcount
|
||||
137, // refcounts:uniffi_uniffi_fixture_refcounts_fn_func_get_js_refcount
|
||||
)
|
||||
}
|
||||
return handleRustResult(functionCall(), liftResult, liftError);
|
||||
@@ -439,7 +439,7 @@ export function getSingleton() {
|
||||
const liftError = null;
|
||||
const functionCall = () => {
|
||||
return UniFFIScaffolding.callSync(
|
||||
137, // refcounts:uniffi_uniffi_fixture_refcounts_fn_func_get_singleton
|
||||
138, // refcounts:uniffi_uniffi_fixture_refcounts_fn_func_get_singleton
|
||||
)
|
||||
}
|
||||
return handleRustResult(functionCall(), liftResult, liftError);
|
||||
|
||||
@@ -665,7 +665,7 @@ export class Optionneur {
|
||||
const liftError = null;
|
||||
const functionCall = () => {
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
169, // rondpoint:uniffi_uniffi_rondpoint_fn_constructor_optionneur_new
|
||||
170, // rondpoint:uniffi_uniffi_rondpoint_fn_constructor_optionneur_new
|
||||
)
|
||||
}
|
||||
try {
|
||||
@@ -691,7 +691,7 @@ export class Optionneur {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
144, // rondpoint:uniffi_uniffi_rondpoint_fn_method_optionneur_sinon_boolean
|
||||
145, // rondpoint:uniffi_uniffi_rondpoint_fn_method_optionneur_sinon_boolean
|
||||
FfiConverterTypeOptionneur.lower(this),
|
||||
FfiConverterBool.lower(value),
|
||||
)
|
||||
@@ -720,7 +720,7 @@ export class Optionneur {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
145, // rondpoint:uniffi_uniffi_rondpoint_fn_method_optionneur_sinon_enum
|
||||
146, // rondpoint:uniffi_uniffi_rondpoint_fn_method_optionneur_sinon_enum
|
||||
FfiConverterTypeOptionneur.lower(this),
|
||||
FfiConverterTypeEnumeration.lower(value),
|
||||
)
|
||||
@@ -749,7 +749,7 @@ export class Optionneur {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
146, // rondpoint:uniffi_uniffi_rondpoint_fn_method_optionneur_sinon_f32
|
||||
147, // rondpoint:uniffi_uniffi_rondpoint_fn_method_optionneur_sinon_f32
|
||||
FfiConverterTypeOptionneur.lower(this),
|
||||
FfiConverterF32.lower(value),
|
||||
)
|
||||
@@ -778,7 +778,7 @@ export class Optionneur {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
147, // rondpoint:uniffi_uniffi_rondpoint_fn_method_optionneur_sinon_f64
|
||||
148, // rondpoint:uniffi_uniffi_rondpoint_fn_method_optionneur_sinon_f64
|
||||
FfiConverterTypeOptionneur.lower(this),
|
||||
FfiConverterF64.lower(value),
|
||||
)
|
||||
@@ -807,7 +807,7 @@ export class Optionneur {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
148, // rondpoint:uniffi_uniffi_rondpoint_fn_method_optionneur_sinon_i16_dec
|
||||
149, // rondpoint:uniffi_uniffi_rondpoint_fn_method_optionneur_sinon_i16_dec
|
||||
FfiConverterTypeOptionneur.lower(this),
|
||||
FfiConverterI16.lower(value),
|
||||
)
|
||||
@@ -836,7 +836,7 @@ export class Optionneur {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
149, // rondpoint:uniffi_uniffi_rondpoint_fn_method_optionneur_sinon_i16_hex
|
||||
150, // rondpoint:uniffi_uniffi_rondpoint_fn_method_optionneur_sinon_i16_hex
|
||||
FfiConverterTypeOptionneur.lower(this),
|
||||
FfiConverterI16.lower(value),
|
||||
)
|
||||
@@ -865,7 +865,7 @@ export class Optionneur {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
150, // rondpoint:uniffi_uniffi_rondpoint_fn_method_optionneur_sinon_i32_dec
|
||||
151, // rondpoint:uniffi_uniffi_rondpoint_fn_method_optionneur_sinon_i32_dec
|
||||
FfiConverterTypeOptionneur.lower(this),
|
||||
FfiConverterI32.lower(value),
|
||||
)
|
||||
@@ -894,7 +894,7 @@ export class Optionneur {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
151, // rondpoint:uniffi_uniffi_rondpoint_fn_method_optionneur_sinon_i32_hex
|
||||
152, // rondpoint:uniffi_uniffi_rondpoint_fn_method_optionneur_sinon_i32_hex
|
||||
FfiConverterTypeOptionneur.lower(this),
|
||||
FfiConverterI32.lower(value),
|
||||
)
|
||||
@@ -923,7 +923,7 @@ export class Optionneur {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
152, // rondpoint:uniffi_uniffi_rondpoint_fn_method_optionneur_sinon_i64_dec
|
||||
153, // rondpoint:uniffi_uniffi_rondpoint_fn_method_optionneur_sinon_i64_dec
|
||||
FfiConverterTypeOptionneur.lower(this),
|
||||
FfiConverterI64.lower(value),
|
||||
)
|
||||
@@ -952,7 +952,7 @@ export class Optionneur {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
153, // rondpoint:uniffi_uniffi_rondpoint_fn_method_optionneur_sinon_i64_hex
|
||||
154, // rondpoint:uniffi_uniffi_rondpoint_fn_method_optionneur_sinon_i64_hex
|
||||
FfiConverterTypeOptionneur.lower(this),
|
||||
FfiConverterI64.lower(value),
|
||||
)
|
||||
@@ -981,7 +981,7 @@ export class Optionneur {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
154, // rondpoint:uniffi_uniffi_rondpoint_fn_method_optionneur_sinon_i8_dec
|
||||
155, // rondpoint:uniffi_uniffi_rondpoint_fn_method_optionneur_sinon_i8_dec
|
||||
FfiConverterTypeOptionneur.lower(this),
|
||||
FfiConverterI8.lower(value),
|
||||
)
|
||||
@@ -1010,7 +1010,7 @@ export class Optionneur {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
155, // rondpoint:uniffi_uniffi_rondpoint_fn_method_optionneur_sinon_i8_hex
|
||||
156, // rondpoint:uniffi_uniffi_rondpoint_fn_method_optionneur_sinon_i8_hex
|
||||
FfiConverterTypeOptionneur.lower(this),
|
||||
FfiConverterI8.lower(value),
|
||||
)
|
||||
@@ -1039,7 +1039,7 @@ export class Optionneur {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
156, // rondpoint:uniffi_uniffi_rondpoint_fn_method_optionneur_sinon_null
|
||||
157, // rondpoint:uniffi_uniffi_rondpoint_fn_method_optionneur_sinon_null
|
||||
FfiConverterTypeOptionneur.lower(this),
|
||||
FfiConverterOptionalstring.lower(value),
|
||||
)
|
||||
@@ -1068,7 +1068,7 @@ export class Optionneur {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
157, // rondpoint:uniffi_uniffi_rondpoint_fn_method_optionneur_sinon_sequence
|
||||
158, // rondpoint:uniffi_uniffi_rondpoint_fn_method_optionneur_sinon_sequence
|
||||
FfiConverterTypeOptionneur.lower(this),
|
||||
FfiConverterSequencestring.lower(value),
|
||||
)
|
||||
@@ -1097,7 +1097,7 @@ export class Optionneur {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
158, // rondpoint:uniffi_uniffi_rondpoint_fn_method_optionneur_sinon_string
|
||||
159, // rondpoint:uniffi_uniffi_rondpoint_fn_method_optionneur_sinon_string
|
||||
FfiConverterTypeOptionneur.lower(this),
|
||||
FfiConverterString.lower(value),
|
||||
)
|
||||
@@ -1126,7 +1126,7 @@ export class Optionneur {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
159, // rondpoint:uniffi_uniffi_rondpoint_fn_method_optionneur_sinon_u16_dec
|
||||
160, // rondpoint:uniffi_uniffi_rondpoint_fn_method_optionneur_sinon_u16_dec
|
||||
FfiConverterTypeOptionneur.lower(this),
|
||||
FfiConverterU16.lower(value),
|
||||
)
|
||||
@@ -1155,7 +1155,7 @@ export class Optionneur {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
160, // rondpoint:uniffi_uniffi_rondpoint_fn_method_optionneur_sinon_u16_hex
|
||||
161, // rondpoint:uniffi_uniffi_rondpoint_fn_method_optionneur_sinon_u16_hex
|
||||
FfiConverterTypeOptionneur.lower(this),
|
||||
FfiConverterU16.lower(value),
|
||||
)
|
||||
@@ -1184,7 +1184,7 @@ export class Optionneur {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
161, // rondpoint:uniffi_uniffi_rondpoint_fn_method_optionneur_sinon_u32_dec
|
||||
162, // rondpoint:uniffi_uniffi_rondpoint_fn_method_optionneur_sinon_u32_dec
|
||||
FfiConverterTypeOptionneur.lower(this),
|
||||
FfiConverterU32.lower(value),
|
||||
)
|
||||
@@ -1213,7 +1213,7 @@ export class Optionneur {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
162, // rondpoint:uniffi_uniffi_rondpoint_fn_method_optionneur_sinon_u32_hex
|
||||
163, // rondpoint:uniffi_uniffi_rondpoint_fn_method_optionneur_sinon_u32_hex
|
||||
FfiConverterTypeOptionneur.lower(this),
|
||||
FfiConverterU32.lower(value),
|
||||
)
|
||||
@@ -1242,7 +1242,7 @@ export class Optionneur {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
163, // rondpoint:uniffi_uniffi_rondpoint_fn_method_optionneur_sinon_u32_oct
|
||||
164, // rondpoint:uniffi_uniffi_rondpoint_fn_method_optionneur_sinon_u32_oct
|
||||
FfiConverterTypeOptionneur.lower(this),
|
||||
FfiConverterU32.lower(value),
|
||||
)
|
||||
@@ -1271,7 +1271,7 @@ export class Optionneur {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
164, // rondpoint:uniffi_uniffi_rondpoint_fn_method_optionneur_sinon_u64_dec
|
||||
165, // rondpoint:uniffi_uniffi_rondpoint_fn_method_optionneur_sinon_u64_dec
|
||||
FfiConverterTypeOptionneur.lower(this),
|
||||
FfiConverterU64.lower(value),
|
||||
)
|
||||
@@ -1300,7 +1300,7 @@ export class Optionneur {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
165, // rondpoint:uniffi_uniffi_rondpoint_fn_method_optionneur_sinon_u64_hex
|
||||
166, // rondpoint:uniffi_uniffi_rondpoint_fn_method_optionneur_sinon_u64_hex
|
||||
FfiConverterTypeOptionneur.lower(this),
|
||||
FfiConverterU64.lower(value),
|
||||
)
|
||||
@@ -1329,7 +1329,7 @@ export class Optionneur {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
166, // rondpoint:uniffi_uniffi_rondpoint_fn_method_optionneur_sinon_u8_dec
|
||||
167, // rondpoint:uniffi_uniffi_rondpoint_fn_method_optionneur_sinon_u8_dec
|
||||
FfiConverterTypeOptionneur.lower(this),
|
||||
FfiConverterU8.lower(value),
|
||||
)
|
||||
@@ -1358,7 +1358,7 @@ export class Optionneur {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
167, // rondpoint:uniffi_uniffi_rondpoint_fn_method_optionneur_sinon_u8_hex
|
||||
168, // rondpoint:uniffi_uniffi_rondpoint_fn_method_optionneur_sinon_u8_hex
|
||||
FfiConverterTypeOptionneur.lower(this),
|
||||
FfiConverterU8.lower(value),
|
||||
)
|
||||
@@ -1387,7 +1387,7 @@ export class Optionneur {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
168, // rondpoint:uniffi_uniffi_rondpoint_fn_method_optionneur_sinon_zero
|
||||
169, // rondpoint:uniffi_uniffi_rondpoint_fn_method_optionneur_sinon_zero
|
||||
FfiConverterTypeOptionneur.lower(this),
|
||||
FfiConverterOptionali32.lower(value),
|
||||
)
|
||||
@@ -1455,7 +1455,7 @@ export class Retourneur {
|
||||
const liftError = null;
|
||||
const functionCall = () => {
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
185, // rondpoint:uniffi_uniffi_rondpoint_fn_constructor_retourneur_new
|
||||
186, // rondpoint:uniffi_uniffi_rondpoint_fn_constructor_retourneur_new
|
||||
)
|
||||
}
|
||||
try {
|
||||
@@ -1481,7 +1481,7 @@ export class Retourneur {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
170, // rondpoint:uniffi_uniffi_rondpoint_fn_method_retourneur_identique_boolean
|
||||
171, // rondpoint:uniffi_uniffi_rondpoint_fn_method_retourneur_identique_boolean
|
||||
FfiConverterTypeRetourneur.lower(this),
|
||||
FfiConverterBool.lower(value),
|
||||
)
|
||||
@@ -1510,7 +1510,7 @@ export class Retourneur {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
171, // rondpoint:uniffi_uniffi_rondpoint_fn_method_retourneur_identique_double
|
||||
172, // rondpoint:uniffi_uniffi_rondpoint_fn_method_retourneur_identique_double
|
||||
FfiConverterTypeRetourneur.lower(this),
|
||||
FfiConverterF64.lower(value),
|
||||
)
|
||||
@@ -1539,7 +1539,7 @@ export class Retourneur {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
172, // rondpoint:uniffi_uniffi_rondpoint_fn_method_retourneur_identique_float
|
||||
173, // rondpoint:uniffi_uniffi_rondpoint_fn_method_retourneur_identique_float
|
||||
FfiConverterTypeRetourneur.lower(this),
|
||||
FfiConverterF32.lower(value),
|
||||
)
|
||||
@@ -1568,7 +1568,7 @@ export class Retourneur {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
173, // rondpoint:uniffi_uniffi_rondpoint_fn_method_retourneur_identique_i16
|
||||
174, // rondpoint:uniffi_uniffi_rondpoint_fn_method_retourneur_identique_i16
|
||||
FfiConverterTypeRetourneur.lower(this),
|
||||
FfiConverterI16.lower(value),
|
||||
)
|
||||
@@ -1597,7 +1597,7 @@ export class Retourneur {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
174, // rondpoint:uniffi_uniffi_rondpoint_fn_method_retourneur_identique_i32
|
||||
175, // rondpoint:uniffi_uniffi_rondpoint_fn_method_retourneur_identique_i32
|
||||
FfiConverterTypeRetourneur.lower(this),
|
||||
FfiConverterI32.lower(value),
|
||||
)
|
||||
@@ -1626,7 +1626,7 @@ export class Retourneur {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
175, // rondpoint:uniffi_uniffi_rondpoint_fn_method_retourneur_identique_i64
|
||||
176, // rondpoint:uniffi_uniffi_rondpoint_fn_method_retourneur_identique_i64
|
||||
FfiConverterTypeRetourneur.lower(this),
|
||||
FfiConverterI64.lower(value),
|
||||
)
|
||||
@@ -1655,7 +1655,7 @@ export class Retourneur {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
176, // rondpoint:uniffi_uniffi_rondpoint_fn_method_retourneur_identique_i8
|
||||
177, // rondpoint:uniffi_uniffi_rondpoint_fn_method_retourneur_identique_i8
|
||||
FfiConverterTypeRetourneur.lower(this),
|
||||
FfiConverterI8.lower(value),
|
||||
)
|
||||
@@ -1684,7 +1684,7 @@ export class Retourneur {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
177, // rondpoint:uniffi_uniffi_rondpoint_fn_method_retourneur_identique_nombres
|
||||
178, // rondpoint:uniffi_uniffi_rondpoint_fn_method_retourneur_identique_nombres
|
||||
FfiConverterTypeRetourneur.lower(this),
|
||||
FfiConverterTypeDictionnaireNombres.lower(value),
|
||||
)
|
||||
@@ -1713,7 +1713,7 @@ export class Retourneur {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
178, // rondpoint:uniffi_uniffi_rondpoint_fn_method_retourneur_identique_nombres_signes
|
||||
179, // rondpoint:uniffi_uniffi_rondpoint_fn_method_retourneur_identique_nombres_signes
|
||||
FfiConverterTypeRetourneur.lower(this),
|
||||
FfiConverterTypeDictionnaireNombresSignes.lower(value),
|
||||
)
|
||||
@@ -1742,7 +1742,7 @@ export class Retourneur {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
179, // rondpoint:uniffi_uniffi_rondpoint_fn_method_retourneur_identique_optionneur_dictionnaire
|
||||
180, // rondpoint:uniffi_uniffi_rondpoint_fn_method_retourneur_identique_optionneur_dictionnaire
|
||||
FfiConverterTypeRetourneur.lower(this),
|
||||
FfiConverterTypeOptionneurDictionnaire.lower(value),
|
||||
)
|
||||
@@ -1771,7 +1771,7 @@ export class Retourneur {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
180, // rondpoint:uniffi_uniffi_rondpoint_fn_method_retourneur_identique_string
|
||||
181, // rondpoint:uniffi_uniffi_rondpoint_fn_method_retourneur_identique_string
|
||||
FfiConverterTypeRetourneur.lower(this),
|
||||
FfiConverterString.lower(value),
|
||||
)
|
||||
@@ -1800,7 +1800,7 @@ export class Retourneur {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
181, // rondpoint:uniffi_uniffi_rondpoint_fn_method_retourneur_identique_u16
|
||||
182, // rondpoint:uniffi_uniffi_rondpoint_fn_method_retourneur_identique_u16
|
||||
FfiConverterTypeRetourneur.lower(this),
|
||||
FfiConverterU16.lower(value),
|
||||
)
|
||||
@@ -1829,7 +1829,7 @@ export class Retourneur {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
182, // rondpoint:uniffi_uniffi_rondpoint_fn_method_retourneur_identique_u32
|
||||
183, // rondpoint:uniffi_uniffi_rondpoint_fn_method_retourneur_identique_u32
|
||||
FfiConverterTypeRetourneur.lower(this),
|
||||
FfiConverterU32.lower(value),
|
||||
)
|
||||
@@ -1858,7 +1858,7 @@ export class Retourneur {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
183, // rondpoint:uniffi_uniffi_rondpoint_fn_method_retourneur_identique_u64
|
||||
184, // rondpoint:uniffi_uniffi_rondpoint_fn_method_retourneur_identique_u64
|
||||
FfiConverterTypeRetourneur.lower(this),
|
||||
FfiConverterU64.lower(value),
|
||||
)
|
||||
@@ -1887,7 +1887,7 @@ export class Retourneur {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
184, // rondpoint:uniffi_uniffi_rondpoint_fn_method_retourneur_identique_u8
|
||||
185, // rondpoint:uniffi_uniffi_rondpoint_fn_method_retourneur_identique_u8
|
||||
FfiConverterTypeRetourneur.lower(this),
|
||||
FfiConverterU8.lower(value),
|
||||
)
|
||||
@@ -1955,7 +1955,7 @@ export class Stringifier {
|
||||
const liftError = null;
|
||||
const functionCall = () => {
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
198, // rondpoint:uniffi_uniffi_rondpoint_fn_constructor_stringifier_new
|
||||
199, // rondpoint:uniffi_uniffi_rondpoint_fn_constructor_stringifier_new
|
||||
)
|
||||
}
|
||||
try {
|
||||
@@ -1981,7 +1981,7 @@ export class Stringifier {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
186, // rondpoint:uniffi_uniffi_rondpoint_fn_method_stringifier_to_string_boolean
|
||||
187, // rondpoint:uniffi_uniffi_rondpoint_fn_method_stringifier_to_string_boolean
|
||||
FfiConverterTypeStringifier.lower(this),
|
||||
FfiConverterBool.lower(value),
|
||||
)
|
||||
@@ -2010,7 +2010,7 @@ export class Stringifier {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
187, // rondpoint:uniffi_uniffi_rondpoint_fn_method_stringifier_to_string_double
|
||||
188, // rondpoint:uniffi_uniffi_rondpoint_fn_method_stringifier_to_string_double
|
||||
FfiConverterTypeStringifier.lower(this),
|
||||
FfiConverterF64.lower(value),
|
||||
)
|
||||
@@ -2039,7 +2039,7 @@ export class Stringifier {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
188, // rondpoint:uniffi_uniffi_rondpoint_fn_method_stringifier_to_string_float
|
||||
189, // rondpoint:uniffi_uniffi_rondpoint_fn_method_stringifier_to_string_float
|
||||
FfiConverterTypeStringifier.lower(this),
|
||||
FfiConverterF32.lower(value),
|
||||
)
|
||||
@@ -2068,7 +2068,7 @@ export class Stringifier {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
189, // rondpoint:uniffi_uniffi_rondpoint_fn_method_stringifier_to_string_i16
|
||||
190, // rondpoint:uniffi_uniffi_rondpoint_fn_method_stringifier_to_string_i16
|
||||
FfiConverterTypeStringifier.lower(this),
|
||||
FfiConverterI16.lower(value),
|
||||
)
|
||||
@@ -2097,7 +2097,7 @@ export class Stringifier {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
190, // rondpoint:uniffi_uniffi_rondpoint_fn_method_stringifier_to_string_i32
|
||||
191, // rondpoint:uniffi_uniffi_rondpoint_fn_method_stringifier_to_string_i32
|
||||
FfiConverterTypeStringifier.lower(this),
|
||||
FfiConverterI32.lower(value),
|
||||
)
|
||||
@@ -2126,7 +2126,7 @@ export class Stringifier {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
191, // rondpoint:uniffi_uniffi_rondpoint_fn_method_stringifier_to_string_i64
|
||||
192, // rondpoint:uniffi_uniffi_rondpoint_fn_method_stringifier_to_string_i64
|
||||
FfiConverterTypeStringifier.lower(this),
|
||||
FfiConverterI64.lower(value),
|
||||
)
|
||||
@@ -2155,7 +2155,7 @@ export class Stringifier {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
192, // rondpoint:uniffi_uniffi_rondpoint_fn_method_stringifier_to_string_i8
|
||||
193, // rondpoint:uniffi_uniffi_rondpoint_fn_method_stringifier_to_string_i8
|
||||
FfiConverterTypeStringifier.lower(this),
|
||||
FfiConverterI8.lower(value),
|
||||
)
|
||||
@@ -2184,7 +2184,7 @@ export class Stringifier {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
193, // rondpoint:uniffi_uniffi_rondpoint_fn_method_stringifier_to_string_u16
|
||||
194, // rondpoint:uniffi_uniffi_rondpoint_fn_method_stringifier_to_string_u16
|
||||
FfiConverterTypeStringifier.lower(this),
|
||||
FfiConverterU16.lower(value),
|
||||
)
|
||||
@@ -2213,7 +2213,7 @@ export class Stringifier {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
194, // rondpoint:uniffi_uniffi_rondpoint_fn_method_stringifier_to_string_u32
|
||||
195, // rondpoint:uniffi_uniffi_rondpoint_fn_method_stringifier_to_string_u32
|
||||
FfiConverterTypeStringifier.lower(this),
|
||||
FfiConverterU32.lower(value),
|
||||
)
|
||||
@@ -2242,7 +2242,7 @@ export class Stringifier {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
195, // rondpoint:uniffi_uniffi_rondpoint_fn_method_stringifier_to_string_u64
|
||||
196, // rondpoint:uniffi_uniffi_rondpoint_fn_method_stringifier_to_string_u64
|
||||
FfiConverterTypeStringifier.lower(this),
|
||||
FfiConverterU64.lower(value),
|
||||
)
|
||||
@@ -2271,7 +2271,7 @@ export class Stringifier {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
196, // rondpoint:uniffi_uniffi_rondpoint_fn_method_stringifier_to_string_u8
|
||||
197, // rondpoint:uniffi_uniffi_rondpoint_fn_method_stringifier_to_string_u8
|
||||
FfiConverterTypeStringifier.lower(this),
|
||||
FfiConverterU8.lower(value),
|
||||
)
|
||||
@@ -2300,7 +2300,7 @@ export class Stringifier {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
197, // rondpoint:uniffi_uniffi_rondpoint_fn_method_stringifier_well_known_string
|
||||
198, // rondpoint:uniffi_uniffi_rondpoint_fn_method_stringifier_well_known_string
|
||||
FfiConverterTypeStringifier.lower(this),
|
||||
FfiConverterString.lower(value),
|
||||
)
|
||||
@@ -3677,7 +3677,7 @@ export function copieCarte(c) {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
139, // rondpoint:uniffi_uniffi_rondpoint_fn_func_copie_carte
|
||||
140, // rondpoint:uniffi_uniffi_rondpoint_fn_func_copie_carte
|
||||
FfiConverterMapStringTypeEnumerationAvecDonnees.lower(c),
|
||||
)
|
||||
}
|
||||
@@ -3706,7 +3706,7 @@ export function copieDictionnaire(d) {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
140, // rondpoint:uniffi_uniffi_rondpoint_fn_func_copie_dictionnaire
|
||||
141, // rondpoint:uniffi_uniffi_rondpoint_fn_func_copie_dictionnaire
|
||||
FfiConverterTypeDictionnaire.lower(d),
|
||||
)
|
||||
}
|
||||
@@ -3735,7 +3735,7 @@ export function copieEnumeration(e) {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
141, // rondpoint:uniffi_uniffi_rondpoint_fn_func_copie_enumeration
|
||||
142, // rondpoint:uniffi_uniffi_rondpoint_fn_func_copie_enumeration
|
||||
FfiConverterTypeEnumeration.lower(e),
|
||||
)
|
||||
}
|
||||
@@ -3764,7 +3764,7 @@ export function copieEnumerations(e) {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
142, // rondpoint:uniffi_uniffi_rondpoint_fn_func_copie_enumerations
|
||||
143, // rondpoint:uniffi_uniffi_rondpoint_fn_func_copie_enumerations
|
||||
FfiConverterSequenceTypeEnumeration.lower(e),
|
||||
)
|
||||
}
|
||||
@@ -3793,7 +3793,7 @@ export function switcheroo(b) {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
143, // rondpoint:uniffi_uniffi_rondpoint_fn_func_switcheroo
|
||||
144, // rondpoint:uniffi_uniffi_rondpoint_fn_func_switcheroo
|
||||
FfiConverterBool.lower(b),
|
||||
)
|
||||
}
|
||||
|
||||
@@ -370,7 +370,7 @@ export class Sprite {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
203, // sprites:uniffi_uniffi_sprites_fn_constructor_sprite_new
|
||||
204, // sprites:uniffi_uniffi_sprites_fn_constructor_sprite_new
|
||||
FfiConverterOptionalTypePoint.lower(initialPosition),
|
||||
)
|
||||
}
|
||||
@@ -404,7 +404,7 @@ export class Sprite {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
204, // sprites:uniffi_uniffi_sprites_fn_constructor_sprite_new_relative_to
|
||||
205, // sprites:uniffi_uniffi_sprites_fn_constructor_sprite_new_relative_to
|
||||
FfiConverterTypePoint.lower(reference),
|
||||
FfiConverterTypeVector.lower(direction),
|
||||
)
|
||||
@@ -424,7 +424,7 @@ export class Sprite {
|
||||
const liftError = null;
|
||||
const functionCall = () => {
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
200, // sprites:uniffi_uniffi_sprites_fn_method_sprite_get_position
|
||||
201, // sprites:uniffi_uniffi_sprites_fn_method_sprite_get_position
|
||||
FfiConverterTypeSprite.lower(this),
|
||||
)
|
||||
}
|
||||
@@ -451,7 +451,7 @@ export class Sprite {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
201, // sprites:uniffi_uniffi_sprites_fn_method_sprite_move_by
|
||||
202, // sprites:uniffi_uniffi_sprites_fn_method_sprite_move_by
|
||||
FfiConverterTypeSprite.lower(this),
|
||||
FfiConverterTypeVector.lower(direction),
|
||||
)
|
||||
@@ -479,7 +479,7 @@ export class Sprite {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
202, // sprites:uniffi_uniffi_sprites_fn_method_sprite_move_to
|
||||
203, // sprites:uniffi_uniffi_sprites_fn_method_sprite_move_to
|
||||
FfiConverterTypeSprite.lower(this),
|
||||
FfiConverterTypePoint.lower(position),
|
||||
)
|
||||
@@ -755,7 +755,7 @@ export function translate(p,v) {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
199, // sprites:uniffi_uniffi_sprites_fn_func_translate
|
||||
200, // sprites:uniffi_uniffi_sprites_fn_func_translate
|
||||
FfiConverterTypePoint.lower(p),
|
||||
FfiConverterTypeVector.lower(v),
|
||||
)
|
||||
|
||||
@@ -343,7 +343,7 @@ export class TodoList {
|
||||
const liftError = null;
|
||||
const functionCall = () => {
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
219, // todolist:uniffi_uniffi_todolist_fn_constructor_todolist_new
|
||||
220, // todolist:uniffi_uniffi_todolist_fn_constructor_todolist_new
|
||||
)
|
||||
}
|
||||
try {
|
||||
@@ -368,7 +368,7 @@ export class TodoList {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
208, // todolist:uniffi_uniffi_todolist_fn_method_todolist_add_entries
|
||||
209, // todolist:uniffi_uniffi_todolist_fn_method_todolist_add_entries
|
||||
FfiConverterTypeTodoList.lower(this),
|
||||
FfiConverterSequenceTypeTodoEntry.lower(entries),
|
||||
)
|
||||
@@ -396,7 +396,7 @@ export class TodoList {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
209, // todolist:uniffi_uniffi_todolist_fn_method_todolist_add_entry
|
||||
210, // todolist:uniffi_uniffi_todolist_fn_method_todolist_add_entry
|
||||
FfiConverterTypeTodoList.lower(this),
|
||||
FfiConverterTypeTodoEntry.lower(entry),
|
||||
)
|
||||
@@ -424,7 +424,7 @@ export class TodoList {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
210, // todolist:uniffi_uniffi_todolist_fn_method_todolist_add_item
|
||||
211, // todolist:uniffi_uniffi_todolist_fn_method_todolist_add_item
|
||||
FfiConverterTypeTodoList.lower(this),
|
||||
FfiConverterString.lower(todo),
|
||||
)
|
||||
@@ -452,7 +452,7 @@ export class TodoList {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
211, // todolist:uniffi_uniffi_todolist_fn_method_todolist_add_items
|
||||
212, // todolist:uniffi_uniffi_todolist_fn_method_todolist_add_items
|
||||
FfiConverterTypeTodoList.lower(this),
|
||||
FfiConverterSequencestring.lower(items),
|
||||
)
|
||||
@@ -480,7 +480,7 @@ export class TodoList {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
212, // todolist:uniffi_uniffi_todolist_fn_method_todolist_clear_item
|
||||
213, // todolist:uniffi_uniffi_todolist_fn_method_todolist_clear_item
|
||||
FfiConverterTypeTodoList.lower(this),
|
||||
FfiConverterString.lower(todo),
|
||||
)
|
||||
@@ -501,7 +501,7 @@ export class TodoList {
|
||||
const liftError = null;
|
||||
const functionCall = () => {
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
213, // todolist:uniffi_uniffi_todolist_fn_method_todolist_get_entries
|
||||
214, // todolist:uniffi_uniffi_todolist_fn_method_todolist_get_entries
|
||||
FfiConverterTypeTodoList.lower(this),
|
||||
)
|
||||
}
|
||||
@@ -521,7 +521,7 @@ export class TodoList {
|
||||
const liftError = (data) => FfiConverterTypeTodoError.lift(data);
|
||||
const functionCall = () => {
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
214, // todolist:uniffi_uniffi_todolist_fn_method_todolist_get_first
|
||||
215, // todolist:uniffi_uniffi_todolist_fn_method_todolist_get_first
|
||||
FfiConverterTypeTodoList.lower(this),
|
||||
)
|
||||
}
|
||||
@@ -541,7 +541,7 @@ export class TodoList {
|
||||
const liftError = null;
|
||||
const functionCall = () => {
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
215, // todolist:uniffi_uniffi_todolist_fn_method_todolist_get_items
|
||||
216, // todolist:uniffi_uniffi_todolist_fn_method_todolist_get_items
|
||||
FfiConverterTypeTodoList.lower(this),
|
||||
)
|
||||
}
|
||||
@@ -561,7 +561,7 @@ export class TodoList {
|
||||
const liftError = (data) => FfiConverterTypeTodoError.lift(data);
|
||||
const functionCall = () => {
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
216, // todolist:uniffi_uniffi_todolist_fn_method_todolist_get_last
|
||||
217, // todolist:uniffi_uniffi_todolist_fn_method_todolist_get_last
|
||||
FfiConverterTypeTodoList.lower(this),
|
||||
)
|
||||
}
|
||||
@@ -581,7 +581,7 @@ export class TodoList {
|
||||
const liftError = (data) => FfiConverterTypeTodoError.lift(data);
|
||||
const functionCall = () => {
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
217, // todolist:uniffi_uniffi_todolist_fn_method_todolist_get_last_entry
|
||||
218, // todolist:uniffi_uniffi_todolist_fn_method_todolist_get_last_entry
|
||||
FfiConverterTypeTodoList.lower(this),
|
||||
)
|
||||
}
|
||||
@@ -600,7 +600,7 @@ export class TodoList {
|
||||
const liftError = null;
|
||||
const functionCall = () => {
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
218, // todolist:uniffi_uniffi_todolist_fn_method_todolist_make_default
|
||||
219, // todolist:uniffi_uniffi_todolist_fn_method_todolist_make_default
|
||||
FfiConverterTypeTodoList.lower(this),
|
||||
)
|
||||
}
|
||||
@@ -992,7 +992,7 @@ export function createEntryWith(todo) {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
205, // todolist:uniffi_uniffi_todolist_fn_func_create_entry_with
|
||||
206, // todolist:uniffi_uniffi_todolist_fn_func_create_entry_with
|
||||
FfiConverterString.lower(todo),
|
||||
)
|
||||
}
|
||||
@@ -1013,7 +1013,7 @@ export function getDefaultList() {
|
||||
const liftError = null;
|
||||
const functionCall = () => {
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
206, // todolist:uniffi_uniffi_todolist_fn_func_get_default_list
|
||||
207, // todolist:uniffi_uniffi_todolist_fn_func_get_default_list
|
||||
)
|
||||
}
|
||||
try {
|
||||
@@ -1040,7 +1040,7 @@ export function setDefaultList(list) {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callAsyncWrapper(
|
||||
207, // todolist:uniffi_uniffi_todolist_fn_func_set_default_list
|
||||
208, // todolist:uniffi_uniffi_todolist_fn_func_set_default_list
|
||||
FfiConverterTypeTodoList.lower(list),
|
||||
)
|
||||
}
|
||||
|
||||
@@ -388,7 +388,7 @@ export class Calc {
|
||||
throw e;
|
||||
}
|
||||
return UniFFIScaffolding.callSync(
|
||||
222, // uniffi_trait_interfaces:uniffi_uniffi_trait_interfaces_fn_method_calc_add
|
||||
223, // uniffi_trait_interfaces:uniffi_uniffi_trait_interfaces_fn_method_calc_add
|
||||
FfiConverterTypeCalc.lower(this),
|
||||
FfiConverterU32.lower(a),
|
||||
FfiConverterU32.lower(b),
|
||||
@@ -442,7 +442,7 @@ export function makeBuggyCalculator() {
|
||||
const liftError = null;
|
||||
const functionCall = () => {
|
||||
return UniFFIScaffolding.callSync(
|
||||
220, // uniffi_trait_interfaces:uniffi_uniffi_trait_interfaces_fn_func_make_buggy_calculator
|
||||
221, // uniffi_trait_interfaces:uniffi_uniffi_trait_interfaces_fn_func_make_buggy_calculator
|
||||
)
|
||||
}
|
||||
return handleRustResult(functionCall(), liftResult, liftError);
|
||||
@@ -458,7 +458,7 @@ export function makeCalculator() {
|
||||
const liftError = null;
|
||||
const functionCall = () => {
|
||||
return UniFFIScaffolding.callSync(
|
||||
221, // uniffi_trait_interfaces:uniffi_uniffi_trait_interfaces_fn_func_make_calculator
|
||||
222, // uniffi_trait_interfaces:uniffi_uniffi_trait_interfaces_fn_func_make_calculator
|
||||
)
|
||||
}
|
||||
return handleRustResult(functionCall(), liftResult, liftError);
|
||||
|
||||
@@ -269,6 +269,7 @@ extern "C" {
|
||||
RustBuffer uniffi_remote_settings_fn_method_remotesettingsclient_get_attachment(void*, RustBuffer, RustCallStatus*);
|
||||
RustBuffer uniffi_remote_settings_fn_method_remotesettingsclient_get_records(void*, int8_t, RustCallStatus*);
|
||||
RustBuffer uniffi_remote_settings_fn_method_remotesettingsclient_get_records_map(void*, int8_t, RustCallStatus*);
|
||||
void uniffi_remote_settings_fn_method_remotesettingsclient_sync(void*, RustCallStatus*);
|
||||
void* uniffi_remote_settings_fn_clone_remotesettingsservice(void*, RustCallStatus*);
|
||||
void uniffi_remote_settings_fn_free_remotesettingsservice(void*, RustCallStatus*);
|
||||
void* uniffi_remote_settings_fn_constructor_remotesettingsservice_new(RustBuffer, RustBuffer, RustCallStatus*);
|
||||
@@ -338,6 +339,7 @@ extern "C" {
|
||||
uint16_t uniffi_remote_settings_checksum_method_remotesettingsclient_get_attachment();
|
||||
uint16_t uniffi_remote_settings_checksum_method_remotesettingsclient_get_records();
|
||||
uint16_t uniffi_remote_settings_checksum_method_remotesettingsclient_get_records_map();
|
||||
uint16_t uniffi_remote_settings_checksum_method_remotesettingsclient_sync();
|
||||
uint16_t uniffi_remote_settings_checksum_method_remotesettingsservice_make_client();
|
||||
uint16_t uniffi_remote_settings_checksum_method_remotesettingsservice_sync();
|
||||
uint16_t uniffi_remote_settings_checksum_method_remotesettingsservice_update_config();
|
||||
@@ -417,7 +419,7 @@ extern "C" {
|
||||
uint32_t ffi_search_uniffi_contract_version();
|
||||
void* uniffi_suggest_fn_clone_suggeststore(void*, RustCallStatus*);
|
||||
void uniffi_suggest_fn_free_suggeststore(void*, RustCallStatus*);
|
||||
void* uniffi_suggest_fn_constructor_suggeststore_new(RustBuffer, RustBuffer, RustCallStatus*);
|
||||
void* uniffi_suggest_fn_constructor_suggeststore_new(RustBuffer, void*, RustCallStatus*);
|
||||
void uniffi_suggest_fn_method_suggeststore_clear(void*, RustCallStatus*);
|
||||
void uniffi_suggest_fn_method_suggeststore_clear_dismissed_suggestions(void*, RustCallStatus*);
|
||||
void uniffi_suggest_fn_method_suggeststore_dismiss_suggestion(void*, RustBuffer, RustCallStatus*);
|
||||
@@ -2999,6 +3001,31 @@ public:
|
||||
);
|
||||
}
|
||||
};
|
||||
class ScaffoldingCallHandlerUniffiRemoteSettingsFnMethodRemotesettingsclientSync : public UniffiSyncCallHandler {
|
||||
private:
|
||||
// PrepareRustArgs stores the resulting arguments in these fields
|
||||
typename ScaffoldingObjectConverter<&kRemoteSettingsRemoteSettingsClientPointerType>::IntermediateType mPtr;
|
||||
|
||||
// MakeRustCall stores the result of the call in these fields
|
||||
|
||||
public:
|
||||
void PrepareRustArgs(const dom::Sequence<dom::UniFFIScaffoldingValue>& aArgs, ErrorResult& aError) override {
|
||||
ScaffoldingObjectConverter<&kRemoteSettingsRemoteSettingsClientPointerType>::FromJs(aArgs[0], &mPtr, aError);
|
||||
if (aError.Failed()) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
void MakeRustCall(RustCallStatus* aOutStatus) override {
|
||||
uniffi_remote_settings_fn_method_remotesettingsclient_sync(
|
||||
ScaffoldingObjectConverter<&kRemoteSettingsRemoteSettingsClientPointerType>::IntoRust(std::move(mPtr)),
|
||||
aOutStatus
|
||||
);
|
||||
}
|
||||
|
||||
virtual void ExtractSuccessfulCallResult(JSContext* aCx, dom::Optional<dom::UniFFIScaffoldingValue>& aDest, ErrorResult& aError) override {
|
||||
}
|
||||
};
|
||||
class ScaffoldingCallHandlerUniffiRemoteSettingsFnMethodRemotesettingsserviceMakeClient : public UniffiSyncCallHandler {
|
||||
private:
|
||||
// PrepareRustArgs stores the resulting arguments in these fields
|
||||
@@ -3744,7 +3771,7 @@ class ScaffoldingCallHandlerUniffiSuggestFnConstructorSuggeststoreNew : public U
|
||||
private:
|
||||
// PrepareRustArgs stores the resulting arguments in these fields
|
||||
typename ScaffoldingConverter<RustBuffer>::IntermediateType mPath;
|
||||
typename ScaffoldingConverter<RustBuffer>::IntermediateType mSettingsConfig;
|
||||
typename ScaffoldingObjectConverter<&kRemoteSettingsRemoteSettingsServicePointerType>::IntermediateType mRemoteSettingsService;
|
||||
|
||||
// MakeRustCall stores the result of the call in these fields
|
||||
typename ScaffoldingObjectConverter<&kSuggestSuggestStorePointerType>::IntermediateType mUniffiReturnValue;
|
||||
@@ -3755,7 +3782,7 @@ public:
|
||||
if (aError.Failed()) {
|
||||
return;
|
||||
}
|
||||
ScaffoldingConverter<RustBuffer>::FromJs(aArgs[1], &mSettingsConfig, aError);
|
||||
ScaffoldingObjectConverter<&kRemoteSettingsRemoteSettingsServicePointerType>::FromJs(aArgs[1], &mRemoteSettingsService, aError);
|
||||
if (aError.Failed()) {
|
||||
return;
|
||||
}
|
||||
@@ -3765,7 +3792,7 @@ public:
|
||||
mUniffiReturnValue = ScaffoldingObjectConverter<&kSuggestSuggestStorePointerType>::FromRust(
|
||||
uniffi_suggest_fn_constructor_suggeststore_new(
|
||||
ScaffoldingConverter<RustBuffer>::IntoRust(std::move(mPath)),
|
||||
ScaffoldingConverter<RustBuffer>::IntoRust(std::move(mSettingsConfig)),
|
||||
ScaffoldingObjectConverter<&kRemoteSettingsRemoteSettingsServicePointerType>::IntoRust(std::move(mRemoteSettingsService)),
|
||||
aOutStatus
|
||||
)
|
||||
);
|
||||
@@ -10300,563 +10327,566 @@ UniquePtr<UniffiSyncCallHandler> GetSyncCallHandler(uint64_t aId) {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiRemoteSettingsFnMethodRemotesettingsclientGetRecordsMap>();
|
||||
}
|
||||
case 21: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiRemoteSettingsFnMethodRemotesettingsserviceMakeClient>();
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiRemoteSettingsFnMethodRemotesettingsclientSync>();
|
||||
}
|
||||
case 22: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiRemoteSettingsFnMethodRemotesettingsserviceSync>();
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiRemoteSettingsFnMethodRemotesettingsserviceMakeClient>();
|
||||
}
|
||||
case 23: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiRemoteSettingsFnMethodRemotesettingsserviceUpdateConfig>();
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiRemoteSettingsFnMethodRemotesettingsserviceSync>();
|
||||
}
|
||||
case 24: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiRemoteSettingsFnConstructorRemotesettingsserviceNew>();
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiRemoteSettingsFnMethodRemotesettingsserviceUpdateConfig>();
|
||||
}
|
||||
case 25: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiSearchFnMethodSearchengineselectorClearSearchConfig>();
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiRemoteSettingsFnConstructorRemotesettingsserviceNew>();
|
||||
}
|
||||
case 26: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiSearchFnMethodSearchengineselectorFilterEngineConfiguration>();
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiSearchFnMethodSearchengineselectorClearSearchConfig>();
|
||||
}
|
||||
case 27: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiSearchFnMethodSearchengineselectorSetConfigOverrides>();
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiSearchFnMethodSearchengineselectorFilterEngineConfiguration>();
|
||||
}
|
||||
case 28: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiSearchFnMethodSearchengineselectorSetSearchConfig>();
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiSearchFnMethodSearchengineselectorSetConfigOverrides>();
|
||||
}
|
||||
case 29: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiSearchFnMethodSearchengineselectorUseRemoteSettingsServer>();
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiSearchFnMethodSearchengineselectorSetSearchConfig>();
|
||||
}
|
||||
case 30: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiSearchFnConstructorSearchengineselectorNew>();
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiSearchFnMethodSearchengineselectorUseRemoteSettingsServer>();
|
||||
}
|
||||
case 31: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiSuggestFnFuncRawSuggestionUrlMatches>();
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiSearchFnConstructorSearchengineselectorNew>();
|
||||
}
|
||||
case 32: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiSuggestFnMethodSuggeststoreClear>();
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiSuggestFnFuncRawSuggestionUrlMatches>();
|
||||
}
|
||||
case 33: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiSuggestFnMethodSuggeststoreClearDismissedSuggestions>();
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiSuggestFnMethodSuggeststoreClear>();
|
||||
}
|
||||
case 34: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiSuggestFnMethodSuggeststoreDismissSuggestion>();
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiSuggestFnMethodSuggeststoreClearDismissedSuggestions>();
|
||||
}
|
||||
case 35: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiSuggestFnMethodSuggeststoreFetchGeonames>();
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiSuggestFnMethodSuggeststoreDismissSuggestion>();
|
||||
}
|
||||
case 36: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiSuggestFnMethodSuggeststoreFetchGlobalConfig>();
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiSuggestFnMethodSuggeststoreFetchGeonames>();
|
||||
}
|
||||
case 37: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiSuggestFnMethodSuggeststoreFetchProviderConfig>();
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiSuggestFnMethodSuggeststoreFetchGlobalConfig>();
|
||||
}
|
||||
case 38: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiSuggestFnMethodSuggeststoreIngest>();
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiSuggestFnMethodSuggeststoreFetchProviderConfig>();
|
||||
}
|
||||
case 39: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiSuggestFnMethodSuggeststoreInterrupt>();
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiSuggestFnMethodSuggeststoreIngest>();
|
||||
}
|
||||
case 40: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiSuggestFnMethodSuggeststoreQuery>();
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiSuggestFnMethodSuggeststoreInterrupt>();
|
||||
}
|
||||
case 41: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiSuggestFnMethodSuggeststoreQueryWithMetrics>();
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiSuggestFnMethodSuggeststoreQuery>();
|
||||
}
|
||||
case 42: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiSuggestFnConstructorSuggeststoreNew>();
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiSuggestFnMethodSuggeststoreQueryWithMetrics>();
|
||||
}
|
||||
case 43: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiSuggestFnMethodSuggeststorebuilderBuild>();
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiSuggestFnConstructorSuggeststoreNew>();
|
||||
}
|
||||
case 44: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiSuggestFnMethodSuggeststorebuilderCachePath>();
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiSuggestFnMethodSuggeststorebuilderBuild>();
|
||||
}
|
||||
case 45: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiSuggestFnMethodSuggeststorebuilderDataPath>();
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiSuggestFnMethodSuggeststorebuilderCachePath>();
|
||||
}
|
||||
case 46: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiSuggestFnMethodSuggeststorebuilderLoadExtension>();
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiSuggestFnMethodSuggeststorebuilderDataPath>();
|
||||
}
|
||||
case 47: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiSuggestFnMethodSuggeststorebuilderRemoteSettingsBucketName>();
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiSuggestFnMethodSuggeststorebuilderLoadExtension>();
|
||||
}
|
||||
case 48: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiSuggestFnMethodSuggeststorebuilderRemoteSettingsServer>();
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiSuggestFnMethodSuggeststorebuilderRemoteSettingsBucketName>();
|
||||
}
|
||||
case 49: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiSuggestFnMethodSuggeststorebuilderRemoteSettingsService>();
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiSuggestFnMethodSuggeststorebuilderRemoteSettingsServer>();
|
||||
}
|
||||
case 50: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiSuggestFnConstructorSuggeststorebuilderNew>();
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiSuggestFnMethodSuggeststorebuilderRemoteSettingsService>();
|
||||
}
|
||||
case 51: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiTabsFnMethodRemotecommandstoreAddRemoteCommand>();
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiSuggestFnConstructorSuggeststorebuilderNew>();
|
||||
}
|
||||
case 52: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiTabsFnMethodRemotecommandstoreAddRemoteCommandAt>();
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiTabsFnMethodRemotecommandstoreAddRemoteCommand>();
|
||||
}
|
||||
case 53: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiTabsFnMethodRemotecommandstoreGetUnsentCommands>();
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiTabsFnMethodRemotecommandstoreAddRemoteCommandAt>();
|
||||
}
|
||||
case 54: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiTabsFnMethodRemotecommandstoreRemoveRemoteCommand>();
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiTabsFnMethodRemotecommandstoreGetUnsentCommands>();
|
||||
}
|
||||
case 55: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiTabsFnMethodRemotecommandstoreSetPendingCommandSent>();
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiTabsFnMethodRemotecommandstoreRemoveRemoteCommand>();
|
||||
}
|
||||
case 56: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiTabsFnMethodTabsbridgedengineApply>();
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiTabsFnMethodRemotecommandstoreSetPendingCommandSent>();
|
||||
}
|
||||
case 57: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiTabsFnMethodTabsbridgedengineEnsureCurrentSyncId>();
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiTabsFnMethodTabsbridgedengineApply>();
|
||||
}
|
||||
case 58: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiTabsFnMethodTabsbridgedengineLastSync>();
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiTabsFnMethodTabsbridgedengineEnsureCurrentSyncId>();
|
||||
}
|
||||
case 59: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiTabsFnMethodTabsbridgedenginePrepareForSync>();
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiTabsFnMethodTabsbridgedengineLastSync>();
|
||||
}
|
||||
case 60: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiTabsFnMethodTabsbridgedengineReset>();
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiTabsFnMethodTabsbridgedenginePrepareForSync>();
|
||||
}
|
||||
case 61: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiTabsFnMethodTabsbridgedengineResetSyncId>();
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiTabsFnMethodTabsbridgedengineReset>();
|
||||
}
|
||||
case 62: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiTabsFnMethodTabsbridgedengineSetLastSync>();
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiTabsFnMethodTabsbridgedengineResetSyncId>();
|
||||
}
|
||||
case 63: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiTabsFnMethodTabsbridgedengineSetUploaded>();
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiTabsFnMethodTabsbridgedengineSetLastSync>();
|
||||
}
|
||||
case 64: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiTabsFnMethodTabsbridgedengineStoreIncoming>();
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiTabsFnMethodTabsbridgedengineSetUploaded>();
|
||||
}
|
||||
case 65: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiTabsFnMethodTabsbridgedengineSyncFinished>();
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiTabsFnMethodTabsbridgedengineStoreIncoming>();
|
||||
}
|
||||
case 66: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiTabsFnMethodTabsbridgedengineSyncId>();
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiTabsFnMethodTabsbridgedengineSyncFinished>();
|
||||
}
|
||||
case 67: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiTabsFnMethodTabsbridgedengineSyncStarted>();
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiTabsFnMethodTabsbridgedengineSyncId>();
|
||||
}
|
||||
case 68: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiTabsFnMethodTabsbridgedengineWipe>();
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiTabsFnMethodTabsbridgedengineSyncStarted>();
|
||||
}
|
||||
case 69: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiTabsFnMethodTabsstoreBridgedEngine>();
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiTabsFnMethodTabsbridgedengineWipe>();
|
||||
}
|
||||
case 70: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiTabsFnMethodTabsstoreCloseConnection>();
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiTabsFnMethodTabsstoreBridgedEngine>();
|
||||
}
|
||||
case 71: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiTabsFnMethodTabsstoreGetAll>();
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiTabsFnMethodTabsstoreCloseConnection>();
|
||||
}
|
||||
case 72: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiTabsFnMethodTabsstoreNewRemoteCommandStore>();
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiTabsFnMethodTabsstoreGetAll>();
|
||||
}
|
||||
case 73: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiTabsFnMethodTabsstoreRegisterWithSyncManager>();
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiTabsFnMethodTabsstoreNewRemoteCommandStore>();
|
||||
}
|
||||
case 74: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiTabsFnMethodTabsstoreSetLocalTabs>();
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiTabsFnMethodTabsstoreRegisterWithSyncManager>();
|
||||
}
|
||||
case 75: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiTabsFnConstructorTabsstoreNew>();
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiTabsFnMethodTabsstoreSetLocalTabs>();
|
||||
}
|
||||
case 76: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiWebextStorageFnMethodWebextstoragebridgedengineApply>();
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiTabsFnConstructorTabsstoreNew>();
|
||||
}
|
||||
case 77: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiWebextStorageFnMethodWebextstoragebridgedengineEnsureCurrentSyncId>();
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiWebextStorageFnMethodWebextstoragebridgedengineApply>();
|
||||
}
|
||||
case 78: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiWebextStorageFnMethodWebextstoragebridgedengineLastSync>();
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiWebextStorageFnMethodWebextstoragebridgedengineEnsureCurrentSyncId>();
|
||||
}
|
||||
case 79: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiWebextStorageFnMethodWebextstoragebridgedenginePrepareForSync>();
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiWebextStorageFnMethodWebextstoragebridgedengineLastSync>();
|
||||
}
|
||||
case 80: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiWebextStorageFnMethodWebextstoragebridgedengineReset>();
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiWebextStorageFnMethodWebextstoragebridgedenginePrepareForSync>();
|
||||
}
|
||||
case 81: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiWebextStorageFnMethodWebextstoragebridgedengineResetSyncId>();
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiWebextStorageFnMethodWebextstoragebridgedengineReset>();
|
||||
}
|
||||
case 82: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiWebextStorageFnMethodWebextstoragebridgedengineSetLastSync>();
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiWebextStorageFnMethodWebextstoragebridgedengineResetSyncId>();
|
||||
}
|
||||
case 83: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiWebextStorageFnMethodWebextstoragebridgedengineSetUploaded>();
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiWebextStorageFnMethodWebextstoragebridgedengineSetLastSync>();
|
||||
}
|
||||
case 84: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiWebextStorageFnMethodWebextstoragebridgedengineStoreIncoming>();
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiWebextStorageFnMethodWebextstoragebridgedengineSetUploaded>();
|
||||
}
|
||||
case 85: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiWebextStorageFnMethodWebextstoragebridgedengineSyncFinished>();
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiWebextStorageFnMethodWebextstoragebridgedengineStoreIncoming>();
|
||||
}
|
||||
case 86: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiWebextStorageFnMethodWebextstoragebridgedengineSyncId>();
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiWebextStorageFnMethodWebextstoragebridgedengineSyncFinished>();
|
||||
}
|
||||
case 87: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiWebextStorageFnMethodWebextstoragebridgedengineSyncStarted>();
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiWebextStorageFnMethodWebextstoragebridgedengineSyncId>();
|
||||
}
|
||||
case 88: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiWebextStorageFnMethodWebextstoragebridgedengineWipe>();
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiWebextStorageFnMethodWebextstoragebridgedengineSyncStarted>();
|
||||
}
|
||||
case 89: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiWebextStorageFnMethodWebextstoragestoreBridgedEngine>();
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiWebextStorageFnMethodWebextstoragebridgedengineWipe>();
|
||||
}
|
||||
case 90: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiWebextStorageFnMethodWebextstoragestoreClear>();
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiWebextStorageFnMethodWebextstoragestoreBridgedEngine>();
|
||||
}
|
||||
case 91: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiWebextStorageFnMethodWebextstoragestoreClose>();
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiWebextStorageFnMethodWebextstoragestoreClear>();
|
||||
}
|
||||
case 92: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiWebextStorageFnMethodWebextstoragestoreGet>();
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiWebextStorageFnMethodWebextstoragestoreClose>();
|
||||
}
|
||||
case 93: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiWebextStorageFnMethodWebextstoragestoreGetBytesInUse>();
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiWebextStorageFnMethodWebextstoragestoreGet>();
|
||||
}
|
||||
case 94: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiWebextStorageFnMethodWebextstoragestoreGetSyncedChanges>();
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiWebextStorageFnMethodWebextstoragestoreGetBytesInUse>();
|
||||
}
|
||||
case 95: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiWebextStorageFnMethodWebextstoragestoreRemove>();
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiWebextStorageFnMethodWebextstoragestoreGetSyncedChanges>();
|
||||
}
|
||||
case 96: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiWebextStorageFnMethodWebextstoragestoreSet>();
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiWebextStorageFnMethodWebextstoragestoreRemove>();
|
||||
}
|
||||
case 97: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiWebextStorageFnMethodWebextstoragestoreSet>();
|
||||
}
|
||||
case 98: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiWebextStorageFnConstructorWebextstoragestoreNew>();
|
||||
}
|
||||
|
||||
#ifdef MOZ_UNIFFI_FIXTURES
|
||||
case 98: {
|
||||
case 99: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiArithmeticalFnFuncAdd>();
|
||||
}
|
||||
case 99: {
|
||||
case 100: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiArithmeticalFnFuncDiv>();
|
||||
}
|
||||
case 100: {
|
||||
case 101: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiArithmeticalFnFuncEqual>();
|
||||
}
|
||||
case 101: {
|
||||
case 102: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiArithmeticalFnFuncSub>();
|
||||
}
|
||||
case 102: {
|
||||
case 103: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiCustomTypesFnFuncGetCustomTypesDemo>();
|
||||
}
|
||||
case 103: {
|
||||
case 104: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiFixtureExternalTypesFnFuncGradient>();
|
||||
}
|
||||
case 104: {
|
||||
case 105: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiFixtureExternalTypesFnFuncIntersection>();
|
||||
}
|
||||
case 105: {
|
||||
case 106: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiFixtureExternalTypesFnFuncMoveSpriteToOrigin>();
|
||||
}
|
||||
case 106: {
|
||||
case 107: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiFixtureCallbacksFnFuncCallLogRepeat>();
|
||||
}
|
||||
case 107: {
|
||||
case 108: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiFixtureCallbacksFnFuncLogEvenNumbers>();
|
||||
}
|
||||
case 108: {
|
||||
case 109: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiFixtureCallbacksFnFuncLogEvenNumbersMainThread>();
|
||||
}
|
||||
case 110: {
|
||||
case 111: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiFixtureFuturesFnFuncInitializeGeckoGlobalWorkerQueue>();
|
||||
}
|
||||
case 111: {
|
||||
case 112: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiFixtureFuturesFnFuncInitializeGlobalWorkerQueue>();
|
||||
}
|
||||
case 126: {
|
||||
case 127: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiFixtureFuturesFnMethodFuturetesterCompleteFutures>();
|
||||
}
|
||||
case 128: {
|
||||
case 129: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiFixtureFuturesFnMethodFuturetesterWakeFutures>();
|
||||
}
|
||||
case 129: {
|
||||
case 130: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiFixtureFuturesFnConstructorFuturetesterInit>();
|
||||
}
|
||||
case 130: {
|
||||
case 131: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiFixtureFuturesFnMethodRusttaskRun>();
|
||||
}
|
||||
case 131: {
|
||||
case 132: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiFixtureFuturesFnMethodTravellerName>();
|
||||
}
|
||||
case 132: {
|
||||
case 133: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiFixtureFuturesFnConstructorTravellerNew>();
|
||||
}
|
||||
case 133: {
|
||||
case 134: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiFixtureFuturesFnMethodWorkerqueueAddTask>();
|
||||
}
|
||||
case 134: {
|
||||
case 135: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiGeometryFnFuncGradient>();
|
||||
}
|
||||
case 135: {
|
||||
case 136: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiGeometryFnFuncIntersection>();
|
||||
}
|
||||
case 136: {
|
||||
case 137: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiFixtureRefcountsFnFuncGetJsRefcount>();
|
||||
}
|
||||
case 137: {
|
||||
case 138: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiFixtureRefcountsFnFuncGetSingleton>();
|
||||
}
|
||||
case 138: {
|
||||
case 139: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiFixtureRefcountsFnMethodSingletonobjectMethod>();
|
||||
}
|
||||
case 139: {
|
||||
case 140: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnFuncCopieCarte>();
|
||||
}
|
||||
case 140: {
|
||||
case 141: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnFuncCopieDictionnaire>();
|
||||
}
|
||||
case 141: {
|
||||
case 142: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnFuncCopieEnumeration>();
|
||||
}
|
||||
case 142: {
|
||||
case 143: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnFuncCopieEnumerations>();
|
||||
}
|
||||
case 143: {
|
||||
case 144: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnFuncSwitcheroo>();
|
||||
}
|
||||
case 144: {
|
||||
case 145: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnMethodOptionneurSinonBoolean>();
|
||||
}
|
||||
case 145: {
|
||||
case 146: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnMethodOptionneurSinonEnum>();
|
||||
}
|
||||
case 146: {
|
||||
case 147: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnMethodOptionneurSinonF32>();
|
||||
}
|
||||
case 147: {
|
||||
case 148: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnMethodOptionneurSinonF64>();
|
||||
}
|
||||
case 148: {
|
||||
case 149: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnMethodOptionneurSinonI16Dec>();
|
||||
}
|
||||
case 149: {
|
||||
case 150: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnMethodOptionneurSinonI16Hex>();
|
||||
}
|
||||
case 150: {
|
||||
case 151: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnMethodOptionneurSinonI32Dec>();
|
||||
}
|
||||
case 151: {
|
||||
case 152: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnMethodOptionneurSinonI32Hex>();
|
||||
}
|
||||
case 152: {
|
||||
case 153: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnMethodOptionneurSinonI64Dec>();
|
||||
}
|
||||
case 153: {
|
||||
case 154: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnMethodOptionneurSinonI64Hex>();
|
||||
}
|
||||
case 154: {
|
||||
case 155: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnMethodOptionneurSinonI8Dec>();
|
||||
}
|
||||
case 155: {
|
||||
case 156: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnMethodOptionneurSinonI8Hex>();
|
||||
}
|
||||
case 156: {
|
||||
case 157: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnMethodOptionneurSinonNull>();
|
||||
}
|
||||
case 157: {
|
||||
case 158: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnMethodOptionneurSinonSequence>();
|
||||
}
|
||||
case 158: {
|
||||
case 159: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnMethodOptionneurSinonString>();
|
||||
}
|
||||
case 159: {
|
||||
case 160: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnMethodOptionneurSinonU16Dec>();
|
||||
}
|
||||
case 160: {
|
||||
case 161: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnMethodOptionneurSinonU16Hex>();
|
||||
}
|
||||
case 161: {
|
||||
case 162: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnMethodOptionneurSinonU32Dec>();
|
||||
}
|
||||
case 162: {
|
||||
case 163: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnMethodOptionneurSinonU32Hex>();
|
||||
}
|
||||
case 163: {
|
||||
case 164: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnMethodOptionneurSinonU32Oct>();
|
||||
}
|
||||
case 164: {
|
||||
case 165: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnMethodOptionneurSinonU64Dec>();
|
||||
}
|
||||
case 165: {
|
||||
case 166: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnMethodOptionneurSinonU64Hex>();
|
||||
}
|
||||
case 166: {
|
||||
case 167: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnMethodOptionneurSinonU8Dec>();
|
||||
}
|
||||
case 167: {
|
||||
case 168: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnMethodOptionneurSinonU8Hex>();
|
||||
}
|
||||
case 168: {
|
||||
case 169: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnMethodOptionneurSinonZero>();
|
||||
}
|
||||
case 169: {
|
||||
case 170: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnConstructorOptionneurNew>();
|
||||
}
|
||||
case 170: {
|
||||
case 171: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnMethodRetourneurIdentiqueBoolean>();
|
||||
}
|
||||
case 171: {
|
||||
case 172: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnMethodRetourneurIdentiqueDouble>();
|
||||
}
|
||||
case 172: {
|
||||
case 173: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnMethodRetourneurIdentiqueFloat>();
|
||||
}
|
||||
case 173: {
|
||||
case 174: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnMethodRetourneurIdentiqueI16>();
|
||||
}
|
||||
case 174: {
|
||||
case 175: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnMethodRetourneurIdentiqueI32>();
|
||||
}
|
||||
case 175: {
|
||||
case 176: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnMethodRetourneurIdentiqueI64>();
|
||||
}
|
||||
case 176: {
|
||||
case 177: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnMethodRetourneurIdentiqueI8>();
|
||||
}
|
||||
case 177: {
|
||||
case 178: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnMethodRetourneurIdentiqueNombres>();
|
||||
}
|
||||
case 178: {
|
||||
case 179: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnMethodRetourneurIdentiqueNombresSignes>();
|
||||
}
|
||||
case 179: {
|
||||
case 180: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnMethodRetourneurIdentiqueOptionneurDictionnaire>();
|
||||
}
|
||||
case 180: {
|
||||
case 181: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnMethodRetourneurIdentiqueString>();
|
||||
}
|
||||
case 181: {
|
||||
case 182: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnMethodRetourneurIdentiqueU16>();
|
||||
}
|
||||
case 182: {
|
||||
case 183: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnMethodRetourneurIdentiqueU32>();
|
||||
}
|
||||
case 183: {
|
||||
case 184: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnMethodRetourneurIdentiqueU64>();
|
||||
}
|
||||
case 184: {
|
||||
case 185: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnMethodRetourneurIdentiqueU8>();
|
||||
}
|
||||
case 185: {
|
||||
case 186: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnConstructorRetourneurNew>();
|
||||
}
|
||||
case 186: {
|
||||
case 187: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnMethodStringifierToStringBoolean>();
|
||||
}
|
||||
case 187: {
|
||||
case 188: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnMethodStringifierToStringDouble>();
|
||||
}
|
||||
case 188: {
|
||||
case 189: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnMethodStringifierToStringFloat>();
|
||||
}
|
||||
case 189: {
|
||||
case 190: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnMethodStringifierToStringI16>();
|
||||
}
|
||||
case 190: {
|
||||
case 191: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnMethodStringifierToStringI32>();
|
||||
}
|
||||
case 191: {
|
||||
case 192: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnMethodStringifierToStringI64>();
|
||||
}
|
||||
case 192: {
|
||||
case 193: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnMethodStringifierToStringI8>();
|
||||
}
|
||||
case 193: {
|
||||
case 194: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnMethodStringifierToStringU16>();
|
||||
}
|
||||
case 194: {
|
||||
case 195: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnMethodStringifierToStringU32>();
|
||||
}
|
||||
case 195: {
|
||||
case 196: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnMethodStringifierToStringU64>();
|
||||
}
|
||||
case 196: {
|
||||
case 197: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnMethodStringifierToStringU8>();
|
||||
}
|
||||
case 197: {
|
||||
case 198: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnMethodStringifierWellKnownString>();
|
||||
}
|
||||
case 198: {
|
||||
case 199: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiRondpointFnConstructorStringifierNew>();
|
||||
}
|
||||
case 199: {
|
||||
case 200: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiSpritesFnFuncTranslate>();
|
||||
}
|
||||
case 200: {
|
||||
case 201: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiSpritesFnMethodSpriteGetPosition>();
|
||||
}
|
||||
case 201: {
|
||||
case 202: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiSpritesFnMethodSpriteMoveBy>();
|
||||
}
|
||||
case 202: {
|
||||
case 203: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiSpritesFnMethodSpriteMoveTo>();
|
||||
}
|
||||
case 203: {
|
||||
case 204: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiSpritesFnConstructorSpriteNew>();
|
||||
}
|
||||
case 204: {
|
||||
case 205: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiSpritesFnConstructorSpriteNewRelativeTo>();
|
||||
}
|
||||
case 205: {
|
||||
case 206: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiTodolistFnFuncCreateEntryWith>();
|
||||
}
|
||||
case 206: {
|
||||
case 207: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiTodolistFnFuncGetDefaultList>();
|
||||
}
|
||||
case 207: {
|
||||
case 208: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiTodolistFnFuncSetDefaultList>();
|
||||
}
|
||||
case 208: {
|
||||
case 209: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiTodolistFnMethodTodolistAddEntries>();
|
||||
}
|
||||
case 209: {
|
||||
case 210: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiTodolistFnMethodTodolistAddEntry>();
|
||||
}
|
||||
case 210: {
|
||||
case 211: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiTodolistFnMethodTodolistAddItem>();
|
||||
}
|
||||
case 211: {
|
||||
case 212: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiTodolistFnMethodTodolistAddItems>();
|
||||
}
|
||||
case 212: {
|
||||
case 213: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiTodolistFnMethodTodolistClearItem>();
|
||||
}
|
||||
case 213: {
|
||||
case 214: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiTodolistFnMethodTodolistGetEntries>();
|
||||
}
|
||||
case 214: {
|
||||
case 215: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiTodolistFnMethodTodolistGetFirst>();
|
||||
}
|
||||
case 215: {
|
||||
case 216: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiTodolistFnMethodTodolistGetItems>();
|
||||
}
|
||||
case 216: {
|
||||
case 217: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiTodolistFnMethodTodolistGetLast>();
|
||||
}
|
||||
case 217: {
|
||||
case 218: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiTodolistFnMethodTodolistGetLastEntry>();
|
||||
}
|
||||
case 218: {
|
||||
case 219: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiTodolistFnMethodTodolistMakeDefault>();
|
||||
}
|
||||
case 219: {
|
||||
case 220: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiTodolistFnConstructorTodolistNew>();
|
||||
}
|
||||
case 220: {
|
||||
case 221: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiTraitInterfacesFnFuncMakeBuggyCalculator>();
|
||||
}
|
||||
case 221: {
|
||||
case 222: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiTraitInterfacesFnFuncMakeCalculator>();
|
||||
}
|
||||
case 222: {
|
||||
case 223: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiTraitInterfacesFnMethodCalcAdd>();
|
||||
}
|
||||
#endif /* MOZ_UNIFFI_FIXTURES */
|
||||
@@ -10871,52 +10901,52 @@ UniquePtr<UniffiAsyncCallHandler> GetAsyncCallHandler(uint64_t aId) {
|
||||
|
||||
|
||||
#ifdef MOZ_UNIFFI_FIXTURES
|
||||
case 109: {
|
||||
case 110: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiFixtureFuturesFnFuncExpensiveComputation>();
|
||||
}
|
||||
case 112: {
|
||||
case 113: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiFixtureFuturesFnFuncRoundtripF32>();
|
||||
}
|
||||
case 113: {
|
||||
case 114: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiFixtureFuturesFnFuncRoundtripF64>();
|
||||
}
|
||||
case 114: {
|
||||
case 115: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiFixtureFuturesFnFuncRoundtripI16>();
|
||||
}
|
||||
case 115: {
|
||||
case 116: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiFixtureFuturesFnFuncRoundtripI32>();
|
||||
}
|
||||
case 116: {
|
||||
case 117: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiFixtureFuturesFnFuncRoundtripI64>();
|
||||
}
|
||||
case 117: {
|
||||
case 118: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiFixtureFuturesFnFuncRoundtripI8>();
|
||||
}
|
||||
case 118: {
|
||||
case 119: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiFixtureFuturesFnFuncRoundtripMap>();
|
||||
}
|
||||
case 119: {
|
||||
case 120: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiFixtureFuturesFnFuncRoundtripObj>();
|
||||
}
|
||||
case 120: {
|
||||
case 121: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiFixtureFuturesFnFuncRoundtripString>();
|
||||
}
|
||||
case 121: {
|
||||
case 122: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiFixtureFuturesFnFuncRoundtripU16>();
|
||||
}
|
||||
case 122: {
|
||||
case 123: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiFixtureFuturesFnFuncRoundtripU32>();
|
||||
}
|
||||
case 123: {
|
||||
case 124: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiFixtureFuturesFnFuncRoundtripU64>();
|
||||
}
|
||||
case 124: {
|
||||
case 125: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiFixtureFuturesFnFuncRoundtripU8>();
|
||||
}
|
||||
case 125: {
|
||||
case 126: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiFixtureFuturesFnFuncRoundtripVec>();
|
||||
}
|
||||
case 127: {
|
||||
case 128: {
|
||||
return MakeUnique<ScaffoldingCallHandlerUniffiUniffiFixtureFuturesFnMethodFuturetesterMakeFuture>();
|
||||
}
|
||||
#endif /* MOZ_UNIFFI_FIXTURES */
|
||||
|
||||
Reference in New Issue
Block a user