1/* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
45#![allow(unknown_lints)]
6#![warn(rust_2018_idioms)]
78mod api;
9mod db;
10pub mod error;
11mod ffi;
12mod migration;
13mod schema;
14pub mod store;
15mod sync;
1617pub use migration::MigrationInfo;
1819// We publish some constants from non-public modules.
20pub use sync::STORAGE_VERSION;
2122pub use api::SYNC_MAX_ITEMS;
23pub use api::SYNC_QUOTA_BYTES;
24pub use api::SYNC_QUOTA_BYTES_PER_ITEM;
2526pub use crate::error::{QuotaReason, WebExtStorageApiError};
27pub use crate::store::WebExtStorageStore;
28pub use crate::sync::{bridge::WebExtStorageBridgedEngine, SyncedExtensionChange};
29pub use api::UsageInfo;
30pub use api::{StorageChanges, StorageValueChange};
3132uniffi::include_scaffolding!("webext-storage");
3334use serde_json::Value as JsonValue;
3536uniffi::custom_type!(JsonValue, String, {
37 remote,
38 try_lift: |val| Ok(serde_json::from_str(val.as_str()).unwrap()),
39 lower: |obj| obj.to_string(),
40});
4142// Our UDL uses a `Guid` type.
43use sync_guid::Guid;
44uniffi::custom_type!(Guid, String, {
45 remote,
46 try_lift: |val| Ok(Guid::new(val.as_str())),
47 lower: |obj| obj.into()
48});