Trait tc_transact::fs::File
source · [−]pub trait File<B: BlockData>: Store + 'static {
type Read: FileRead<B, File = Self> + Clone;
type ReadExclusive: FileReadExclusive<B, File = Self>;
type Write: FileWrite<B, File = Self>;
type BlockRead: BlockRead<B>;
type BlockReadExclusive: BlockReadExclusive<B, File = Self>;
type BlockWrite: BlockWrite<B, File = Self>;
fn read<'life0, 'async_trait>(
&'life0 self,
txn_id: TxnId
) -> Pin<Box<dyn Future<Output = TCResult<Self::Read>> + Send + 'async_trait>>
where
'life0: 'async_trait,
Self: 'async_trait;
fn read_exclusive<'life0, 'async_trait>(
&'life0 self,
txn_id: TxnId
) -> Pin<Box<dyn Future<Output = TCResult<Self::ReadExclusive>> + Send + 'async_trait>>
where
'life0: 'async_trait,
Self: 'async_trait;
fn write<'life0, 'async_trait>(
&'life0 self,
txn_id: TxnId
) -> Pin<Box<dyn Future<Output = TCResult<Self::Write>> + Send + 'async_trait>>
where
'life0: 'async_trait,
Self: 'async_trait;
fn read_block<'life0, 'async_trait, I>(
&'life0 self,
txn_id: TxnId,
name: I
) -> Pin<Box<dyn Future<Output = TCResult<Self::BlockRead>> + Send + 'async_trait>>
where
I: Borrow<BlockId> + Send + Sync,
I: 'async_trait,
'life0: 'async_trait,
Self: Sync + 'async_trait,
{ ... }
fn write_block<'life0, 'async_trait, I>(
&'life0 self,
txn_id: TxnId,
name: I
) -> Pin<Box<dyn Future<Output = TCResult<Self::BlockWrite>> + Send + 'async_trait>>
where
I: Borrow<BlockId> + Send + Sync,
I: 'async_trait,
'life0: 'async_trait,
Self: Sync + 'async_trait,
{ ... }
}
Expand description
A transactional file
Required Associated Types
sourcetype ReadExclusive: FileReadExclusive<B, File = Self>
type ReadExclusive: FileReadExclusive<B, File = Self>
The type of exclusive read guard used by this File
sourcetype BlockReadExclusive: BlockReadExclusive<B, File = Self>
type BlockReadExclusive: BlockReadExclusive<B, File = Self>
An exclusive read lock on a block in this file.
sourcetype BlockWrite: BlockWrite<B, File = Self>
type BlockWrite: BlockWrite<B, File = Self>
A write lock on a block in this file.
Required Methods
Lock the contents of this file for reading at the given txn_id
.
sourcefn read_exclusive<'life0, 'async_trait>(
&'life0 self,
txn_id: TxnId
) -> Pin<Box<dyn Future<Output = TCResult<Self::ReadExclusive>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn read_exclusive<'life0, 'async_trait>(
&'life0 self,
txn_id: TxnId
) -> Pin<Box<dyn Future<Output = TCResult<Self::ReadExclusive>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Lock the contents of this file for reading at the given txn_id
, exclusively,
i.e. don’t allow any more read locks while this one is active.
Provided Methods
Convenience method to lock the block at name
for reading.
Convenience method to lock the block at name
for writing.