Skip to main content

StorageLockGuard

Trait StorageLockGuard 

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

Source

fn lock_info(&self) -> &StorageLock

Get the lock information

Source

fn release<'async_trait>( self: Box<Self>, ) -> Pin<Box<dyn Future<Output = StorageResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,

Explicitly release the lock

Source

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,

Extend the lock TTL

Source

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,

Check if the lock is still valid

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§