Expand description
RAII-style Rust wrapper around the Web Locks API (navigator.locks).
Notes
- This uses web-sys unstable bindings and requires compiling with 
--cfg web_sys_unstable_apis. - Target must be 
wasm32-unknown-unknownand run in a browser environment. 
Example
ⓘ
// Build with: RUSTFLAGS="--cfg=web_sys_unstable_apis"
use weblocks::{acquire, AcquireOptions, LockMode};
let _guard = acquire("my_resource", AcquireOptions::exclusive())
    .await?;
// Lock held while `_guard` is in scope; released on drop.Structs§
- Acquire
Options  - Options to control how a lock request is made.
 - Lock
Guard  - Guard that holds a Web Lock until dropped.
 
Enums§
- Lock
Mode  - Lock mode for the Web Locks API.
 
Functions§
- acquire
 - Non-wasm target stub that returns an error at runtime.
 - is_
supported  - Returns true if 
navigator.locksis available in this environment.