pub struct LockedSymbolTable { /* private fields */ }Expand description
A thread-safe symbol table with read/write locking.
This wrapper provides concurrent access to a symbol table with read/write locks, transaction support, and lock statistics tracking.
Implementations§
Source§impl LockedSymbolTable
impl LockedSymbolTable
Sourcepub fn from_table(table: SymbolTable) -> Self
pub fn from_table(table: SymbolTable) -> Self
Create a locked symbol table from an existing symbol table.
Sourcepub fn read(&self) -> RwLockReadGuard<'_, SymbolTable>
pub fn read(&self) -> RwLockReadGuard<'_, SymbolTable>
Acquire a read lock on the symbol table.
This will block until a read lock can be acquired. Multiple readers can hold locks simultaneously.
Sourcepub fn try_read(&self) -> Option<RwLockReadGuard<'_, SymbolTable>>
pub fn try_read(&self) -> Option<RwLockReadGuard<'_, SymbolTable>>
Try to acquire a read lock without blocking.
Returns Some(guard) if successful, None if would block.
Sourcepub fn write(&self) -> RwLockWriteGuard<'_, SymbolTable>
pub fn write(&self) -> RwLockWriteGuard<'_, SymbolTable>
Acquire a write lock on the symbol table.
This will block until a write lock can be acquired. Only one writer can hold a lock at a time, and no readers can be active.
Sourcepub fn try_write(&self) -> Option<RwLockWriteGuard<'_, SymbolTable>>
pub fn try_write(&self) -> Option<RwLockWriteGuard<'_, SymbolTable>>
Try to acquire a write lock without blocking.
Returns Some(guard) if successful, None if would block.
Sourcepub fn reset_stats(&self)
pub fn reset_stats(&self)
Reset lock statistics.
Sourcepub fn begin_transaction(&self) -> Transaction<'_>
pub fn begin_transaction(&self) -> Transaction<'_>
Start a new transaction.
Returns a transaction object that can be committed or rolled back.