dportable
https://crates.io/crates/dportable
Portable interface for various utilities.
Intended targets are:
- native platforms with tokio async runtime,
- WebAssembly targeted to browsers, including WebWorkers, under standard single-threaded model.
Following features are provided:
MutexandRwLock(using parking_lot on native platforms andstd::cell::RefCellin WASM).- asynchronous
spawn(not requiringSendin WASM) andsleep, Timeoutfuture,dtestattribute macro to create tests for both native and WASM targets, alsodtest_configuremacro to configure tests to run in browser.create_non_sync_send_variant_for_wasmutility macro for creating non-Sendand non-Syncvariants of traits for use in WASM.randomfunction.