bitwarden_threading/
lib.rs1#![doc = include_str!("../README.md")]
2
3#[cfg(all(target_arch = "wasm32", not(feature = "wasm")))]
4compile_error!(
5 "The `wasm` feature must be enabled to use the `bitwarden-ipc` crate in a WebAssembly environment."
6);
7
8#[allow(missing_docs)]
9pub mod cancellation_token;
10mod thread_bound_runner;
11#[allow(missing_docs)]
12pub mod time;
13
14pub use thread_bound_runner::{CallError, ThreadBoundRunner};
15
16#[cfg(not(target_arch = "wasm32"))]
18pub fn spawn(future: impl std::future::Future<Output = ()> + Send + 'static) {
19 tokio::spawn(future);
20}
21
22#[cfg(target_arch = "wasm32")]
24pub fn spawn(future: impl std::future::Future<Output = ()> + 'static) {
25 wasm_bindgen_futures::spawn_local(future);
26}