pub trait StorageLockGuard: Send + Sync {
// Required methods
fn lock_info(&self) -> &StorageLock;
fn release<'async_trait>(
self: Box<Self>,
) -> Pin<Box<dyn Future<Output = StorageResult<()>> + Send + 'async_trait>>
where Self: 'async_trait;
fn extend<'life0, 'async_trait>(
&'life0 mut self,
additional_ttl: Duration,
) -> Pin<Box<dyn Future<Output = StorageResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn is_valid<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = StorageResult<bool>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
Lock guard that automatically releases the lock when dropped
Required Methods§
Sourcefn lock_info(&self) -> &StorageLock
fn lock_info(&self) -> &StorageLock
Get the lock information
Sourcefn release<'async_trait>(
self: Box<Self>,
) -> Pin<Box<dyn Future<Output = StorageResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
fn release<'async_trait>(
self: Box<Self>,
) -> Pin<Box<dyn Future<Output = StorageResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
Explicitly release the lock
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".