Trait tc_transact::fs::File [−][src]
pub trait File<B: Clone>: Store + Sized + 'static {
type Read: Deref<Target = B> + Send;
type Write: DerefMut<Target = B> + Send;
fn block_ids<'life0, 'async_trait>(
&'life0 self,
txn_id: TxnId
) -> Pin<Box<dyn Future<Output = TCResult<HashSet<BlockId>>> + Send + 'async_trait>>
where
'life0: 'async_trait,
Self: 'async_trait;
fn contains_block<'life0, 'life1, 'async_trait>(
&'life0 self,
txn_id: TxnId,
name: &'life1 BlockId
) -> Pin<Box<dyn Future<Output = TCResult<bool>> + Send + 'async_trait>>
where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
fn copy_from<'life0, 'life1, 'async_trait>(
&'life0 self,
other: &'life1 Self,
txn_id: TxnId
) -> Pin<Box<dyn Future<Output = TCResult<()>> + Send + 'async_trait>>
where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
fn create_block<'life0, 'async_trait>(
&'life0 self,
txn_id: TxnId,
name: BlockId,
initial_value: B,
size_hint: usize
) -> Pin<Box<dyn Future<Output = TCResult<Self::Write>> + Send + 'async_trait>>
where
'life0: 'async_trait,
Self: 'async_trait;
fn create_block_unique<'life0, 'async_trait>(
&'life0 self,
txn_id: TxnId,
initial_value: B,
size_hint: usize
) -> Pin<Box<dyn Future<Output = TCResult<(BlockId, Self::Write)>> + Send + 'async_trait>>
where
'life0: 'async_trait,
Self: 'async_trait;
fn delete_block<'life0, 'async_trait>(
&'life0 self,
txn_id: TxnId,
name: BlockId
) -> Pin<Box<dyn Future<Output = TCResult<()>> + Send + 'async_trait>>
where
'life0: 'async_trait,
Self: 'async_trait;
fn read_block<'life0, 'async_trait>(
&'life0 self,
txn_id: TxnId,
name: BlockId
) -> Pin<Box<dyn Future<Output = TCResult<Self::Read>> + Send + 'async_trait>>
where
'life0: 'async_trait,
Self: 'async_trait;
fn read_block_owned<'async_trait>(
self,
txn_id: TxnId,
name: BlockId
) -> Pin<Box<dyn Future<Output = TCResult<Self::Read>> + Send + 'async_trait>>
where
Self: 'async_trait;
fn write_block<'life0, 'async_trait>(
&'life0 self,
txn_id: TxnId,
name: BlockId
) -> Pin<Box<dyn Future<Output = TCResult<Self::Write>> + Send + 'async_trait>>
where
'life0: 'async_trait,
Self: 'async_trait;
fn truncate<'life0, 'async_trait>(
&'life0 self,
txn_id: TxnId
) -> Pin<Box<dyn Future<Output = TCResult<()>> + Send + 'async_trait>>
where
'life0: 'async_trait,
Self: 'async_trait;
}
Expand description
A transactional file.
Associated Types
Required methods
Return the IDs of all this File
’s blocks.
Copy all blocks from the source File
into this File
.
Create a new block.
size_hint
should be the maximum allowed size of the block.
Create a new block.
size_hint
should be the maximum allowed size of the block.
Delete the block with the given ID.
Get a read lock on the block at name
.
Get a read lock on the block at name
, without borrowing.
Get a read lock on the block at name
as of TxnId
.