Skip to main content

LockWithTimeout

Trait LockWithTimeout 

Source
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§

Source

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.

Source

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.

Implementors§