use crate::lockable::order::LockableOrder;
use std::pin::Pin;
pub trait Lockable {
type RwLockReadGuard<'a>
where
Self: 'a;
type RwLockWriteGuard<'a>
where
Self: 'a;
fn lockable_order(&self) -> LockableOrder;
fn lockable_decode_sync_ref(&self) -> Self::RwLockReadGuard<'_>;
fn lockable_decode_sync_ref_mut(&self) -> Self::RwLockWriteGuard<'_>;
fn lockable_decode_async_ref<'a>(
&'a self,
) -> Pin<Box<dyn core::future::Future<Output = Self::RwLockReadGuard<'a>> + Send + 'a>>
where
Self: Sync + 'a;
fn lockable_decode_async_ref_mut<'a>(
&'a self,
) -> Pin<Box<dyn core::future::Future<Output = Self::RwLockWriteGuard<'a>> + Send + 'a>>
where
Self: Sync + 'a;
}