Trait tc_transact::fs::FileWrite

source ·
pub trait FileWrite: FileRead {
    fn downgrade(self) -> <Self::File as File>::ReadExclusive;
    fn create_block<'life0, 'async_trait>(
        &'life0 mut self,
        name: <Self::File as File>::Key,
        initial_value: <Self::File as File>::Block,
        size_hint: usize
    ) -> Pin<Box<dyn Future<Output = TCResult<<Self::File as File>::BlockWrite>> + Send + 'async_trait>>
    where
        Self: 'async_trait,
        'life0: 'async_trait
; fn try_create_block(
        &mut self,
        name: <Self::File as File>::Key,
        initial_value: <Self::File as File>::Block,
        size_hint: usize
    ) -> TCResult<<Self::File as File>::BlockWrite>; fn create_block_unique<'life0, 'async_trait>(
        &'life0 mut self,
        initial_value: <Self::File as File>::Block,
        size_hint: usize
    ) -> Pin<Box<dyn Future<Output = TCResult<(<Self::File as File>::Key, <Self::File as File>::BlockWrite)>> + Send + 'async_trait>>
    where
        Self: 'async_trait,
        'life0: 'async_trait
; fn try_create_block_unique(
        &mut self,
        initial_value: <Self::File as File>::Block,
        size_hint: usize
    ) -> TCResult<(<Self::File as File>::Key, <Self::File as File>::BlockWrite)>; fn delete_block<'life0, 'async_trait, Q>(
        &'life0 mut self,
        name: Q
    ) -> Pin<Box<dyn Future<Output = TCResult<()>> + Send + 'async_trait>>
    where
        Q: Borrow<<Self::File as File>::Key> + Send + Sync + 'async_trait,
        Self: 'async_trait,
        'life0: 'async_trait
; fn try_delete_block<Q>(&mut self, name: Q) -> TCResult<()>
    where
        Q: Borrow<<Self::File as File>::Key> + Send + Sync
; fn copy_from<'life0, 'life1, 'async_trait, O>(
        &'life0 mut self,
        other: &'life1 O,
        truncate: bool
    ) -> Pin<Box<dyn Future<Output = TCResult<()>> + Send + 'async_trait>>
    where
        O: FileRead + 'async_trait,
        O::File: File<Key = <Self::File as File>::Key, Block = <Self::File as File>::Block>,
        Self: 'async_trait,
        'life0: 'async_trait,
        'life1: 'async_trait
; fn try_copy_from<O>(&mut self, other: &O, truncate: bool) -> TCResult<()>
    where
        O: FileRead,
        O::File: File<Key = <Self::File as File>::Key, Block = <Self::File as File>::Block>
; fn truncate<'life0, 'async_trait>(
        &'life0 mut self
    ) -> Pin<Box<dyn Future<Output = TCResult<()>> + Send + 'async_trait>>
    where
        Self: 'async_trait,
        'life0: 'async_trait
; fn try_truncate(&mut self) -> TCResult<()>; }
Expand description

A write lock on a File

Required Methods§

Downgrade this write lock to an exclusive read lock.

Create a new block.

Create a new block synchronously, if possible.

Create a new block with a unique random name.

Create a new block with a unique random name, synchronously if possible.

Delete the block with the given name.

Delete the block with the given name synchronously, if possible.

Copy blocks from the other file into this File.

If truncate is true, the destination file will first be truncated.

Copy blocks from the other file into this File synchronously, if possible.

If truncate is true, the destination file will first be truncated.

Delete all of this File’s blocks.

Delete all of this File’s blocks synchronously, if possible.

Implementors§