sync_manager/
lib.rs

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/. */
4
5#![allow(unknown_lints)]
6#![warn(rust_2018_idioms)]
7
8pub mod error;
9pub mod manager;
10mod types;
11
12pub use sync15::DeviceType;
13
14pub use error::{Result, SyncManagerError};
15pub use types::*;
16
17use manager::SyncManager;
18use parking_lot::Mutex;
19
20lazy_static::lazy_static! {
21    static ref MANAGER: Mutex<SyncManager> = Mutex::new(SyncManager::new());
22}
23
24pub(crate) fn wipe(engine: &str) -> Result<()> {
25    let manager = MANAGER.lock();
26    manager.wipe(engine)
27}
28
29pub(crate) fn reset(engine: &str) -> Result<()> {
30    let manager = MANAGER.lock();
31    manager.reset(engine)
32}
33
34pub(crate) fn reset_all() -> Result<()> {
35    let manager = MANAGER.lock();
36    manager.reset_all()
37}
38
39uniffi::include_scaffolding!("syncmanager");