pub trait LockAware {
// Required methods
fn with_read_lock<F, R>(&self, timeout_secs: u64, operation: F) -> Result<R>
where F: FnOnce() -> Result<R>;
fn with_write_lock<F, R>(
&self,
timeout_secs: u64,
operation: F,
) -> Result<R>
where F: FnOnce() -> Result<R>;
}Expand description
Helper trait for lock-aware operations
Required Methods§
fn with_read_lock<F, R>(&self, timeout_secs: u64, operation: F) -> Result<R>
fn with_write_lock<F, R>(&self, timeout_secs: u64, operation: F) -> Result<R>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.