Trait tc_transact::fs::Dir
source · pub trait Dir: Store + Clone + Send + Sized + 'static {
type Read: DirRead<Lock = Self>;
type Write: DirCreate<Lock = Self>;
type Store: Store;
type Inner;
fn read<'life0, 'async_trait>(
&'life0 self,
txn_id: TxnId
) -> Pin<Box<dyn Future<Output = TCResult<Self::Read>> + Send + 'async_trait>>
where
Self: 'async_trait,
'life0: 'async_trait;
fn try_read(&self, txn_id: TxnId) -> TCResult<Self::Read>;
fn write<'life0, 'async_trait>(
&'life0 self,
txn_id: TxnId
) -> Pin<Box<dyn Future<Output = TCResult<Self::Write>> + Send + 'async_trait>>
where
Self: 'async_trait,
'life0: 'async_trait;
fn try_write(&self, txn_id: TxnId) -> TCResult<Self::Write>;
fn into_inner(self) -> Self::Inner;
fn create_dir_unique<'life0, 'async_trait>(
&'life0 self,
txn_id: TxnId
) -> Pin<Box<dyn Future<Output = TCResult<Self>> + Send + 'async_trait>>
where
Self: Sync + 'async_trait,
'life0: 'async_trait,
{ ... }
fn create_file_unique<'life0, 'async_trait, F>(
&'life0 self,
txn_id: TxnId
) -> Pin<Box<dyn Future<Output = TCResult<F>> + Send + 'async_trait>>
where
F: File<Inner = Self::Inner> + 'async_trait,
Self::Write: DirCreateFile<F>,
Self: Sync + 'async_trait,
'life0: 'async_trait,
{ ... }
}
Expand description
A transactional directory
Required Associated Types§
Required Methods§
sourcefn read<'life0, 'async_trait>(
&'life0 self,
txn_id: TxnId
) -> Pin<Box<dyn Future<Output = TCResult<Self::Read>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn read<'life0, 'async_trait>(
&'life0 self,
txn_id: TxnId
) -> Pin<Box<dyn Future<Output = TCResult<Self::Read>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Lock this Dir
for reading.
sourcefn try_read(&self, txn_id: TxnId) -> TCResult<Self::Read>
fn try_read(&self, txn_id: TxnId) -> TCResult<Self::Read>
Lock this Dir
for reading synchronously, if possible.
sourcefn write<'life0, 'async_trait>(
&'life0 self,
txn_id: TxnId
) -> Pin<Box<dyn Future<Output = TCResult<Self::Write>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn write<'life0, 'async_trait>(
&'life0 self,
txn_id: TxnId
) -> Pin<Box<dyn Future<Output = TCResult<Self::Write>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Lock this Dir
for writing.
sourcefn try_write(&self, txn_id: TxnId) -> TCResult<Self::Write>
fn try_write(&self, txn_id: TxnId) -> TCResult<Self::Write>
Lock this Dir
for writing synchronously, if possible.
fn into_inner(self) -> Self::Inner
Provided Methods§
sourcefn create_dir_unique<'life0, 'async_trait>(
&'life0 self,
txn_id: TxnId
) -> Pin<Box<dyn Future<Output = TCResult<Self>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
fn create_dir_unique<'life0, 'async_trait>(
&'life0 self,
txn_id: TxnId
) -> Pin<Box<dyn Future<Output = TCResult<Self>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
Convenience method to create a temporary working directory
sourcefn create_file_unique<'life0, 'async_trait, F>(
&'life0 self,
txn_id: TxnId
) -> Pin<Box<dyn Future<Output = TCResult<F>> + Send + 'async_trait>>where
F: File<Inner = Self::Inner> + 'async_trait,
Self::Write: DirCreateFile<F>,
Self: Sync + 'async_trait,
'life0: 'async_trait,
fn create_file_unique<'life0, 'async_trait, F>(
&'life0 self,
txn_id: TxnId
) -> Pin<Box<dyn Future<Output = TCResult<F>> + Send + 'async_trait>>where
F: File<Inner = Self::Inner> + 'async_trait,
Self::Write: DirCreateFile<F>,
Self: Sync + 'async_trait,
'life0: 'async_trait,
Convenience method to create a temporary file