Module local_rwlock

Source
Expand description

Single-threaded async-aware RwLock. A single-threaded async-aware RwLock implementation.

This module provides LocalRwLock, which is similar to async_lock::RwLock but optimized for single-threaded async runtimes. It avoids atomic operations and is !Send + !Sync, making it more efficient when thread safety is not needed.

Like async_lock::RwLock, it provides read_rc() and write_rc() methods that allow callers to asynchronously wait for the lock to become available, and return guards with 'static lifetimes by holding an Rc to the lock.

Structsยง

LocalRwLock
The main lock type.
LocalRwLockInner ๐Ÿ”’
LocalRwLockReadGuard
A read guard with a 'static lifetime, holding an Rc to the lock.
LocalRwLockWriteGuard
A write guard with a 'static lifetime, holding an Rc to the lock.
ReadFuture
Future returned by read_rc().
WriteFuture
Future returned by write_rc().

Enumsยง

LockState ๐Ÿ”’