pub trait LockWithTimeout {
// Required methods
fn read_timeout(
&self,
timeout: Duration,
) -> Option<RwLockReadGuard<'_, SymbolTable>>;
fn write_timeout(
&self,
timeout: Duration,
) -> Option<RwLockWriteGuard<'_, SymbolTable>>;
}Expand description
Extension trait for timeout-based lock acquisition.
Required Methods§
Sourcefn read_timeout(
&self,
timeout: Duration,
) -> Option<RwLockReadGuard<'_, SymbolTable>>
fn read_timeout( &self, timeout: Duration, ) -> Option<RwLockReadGuard<'_, SymbolTable>>
Try to acquire a read lock with a timeout.
Returns Some(guard) if successful within timeout, None otherwise.
Sourcefn write_timeout(
&self,
timeout: Duration,
) -> Option<RwLockWriteGuard<'_, SymbolTable>>
fn write_timeout( &self, timeout: Duration, ) -> Option<RwLockWriteGuard<'_, SymbolTable>>
Try to acquire a write lock with a timeout.
Returns Some(guard) if successful within timeout, None otherwise.