Crate fut_rwlock[][src]

Expand description

fut_rwlock

FutRwLock returns a Future-wrapped locks to a read-write lock synchronization primitive. It is a wrapper around the std library synchronization primitive std::sync::RwLock.

  • The FutRwLock does not block the calling thread that requests a lock.
  • Any call to [read]FutRwLock::read/write returns an asynchronous Future that must be awaited even if it resolves immediately. If a lock isn’t awaited, it does nothing.
  • To attempt to acquire an Option-wrapped read or write lock synchronously/immediately use the try_read_now or try_write_now. synchronous methods.
  • It was made to be suitable for use in single-threaded wasm environments without running into errors when the environment tries to block upon accessing a synchronization primitive.
  • Locks are alloted to callers in request order.

Structs

A read-write lock that returns futures upon read/write requests.

Async RwLock Read Guard

Async RwLock Write Guard