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

The type of read guard used by this File

The type of exclusive read guard used by this File

The type of write guard used by this File

A read lock on a block in this file.

An exclusive read lock on a block in this file.

A write lock on a block in this file.

Required Methods

Lock the contents of this file for reading at the given txn_id.

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.

Lock the contents of this file for writing.

Provided Methods

Convenience method to lock the block at name for reading.

Convenience method to lock the block at name for writing.

Implementors