Trait tc_transact::fs::FileRead

source ·
pub trait FileRead: Sized + Send + Sync {
    type File: File;

    fn block_ids(&self) -> BTreeSet<<Self::File as File>::Key>;
    fn contains<Q>(&self, name: Q) -> bool
    where
        Q: Borrow<<Self::File as File>::Key>
; fn is_empty(&self) -> bool; fn read_block<'life0, 'async_trait, Q>(
        &'life0 self,
        name: Q
    ) -> Pin<Box<dyn Future<Output = TCResult<<Self::File as File>::BlockRead>> + Send + 'async_trait>>
    where
        Q: Borrow<<Self::File as File>::Key> + Send + Sync + 'async_trait,
        Self: 'async_trait,
        'life0: 'async_trait
; fn try_read_block<Q>(
        &self,
        name: Q
    ) -> TCResult<<Self::File as File>::BlockRead>
    where
        Q: Borrow<<Self::File as File>::Key> + Send + Sync
; fn read_block_exclusive<'life0, 'async_trait, Q>(
        &'life0 self,
        name: Q
    ) -> Pin<Box<dyn Future<Output = TCResult<<Self::File as File>::BlockReadExclusive>> + Send + 'async_trait>>
    where
        Q: Borrow<<Self::File as File>::Key> + Send + Sync + 'async_trait,
        Self: 'async_trait,
        'life0: 'async_trait
; fn try_read_block_exclusive<Q>(
        &self,
        name: Q
    ) -> TCResult<<Self::File as File>::BlockReadExclusive>
    where
        Q: Borrow<<Self::File as File>::Key> + Send + Sync
; fn write_block<'life0, 'async_trait, Q>(
        &'life0 self,
        name: Q
    ) -> Pin<Box<dyn Future<Output = TCResult<<Self::File as File>::BlockWrite>> + Send + 'async_trait>>
    where
        Q: Borrow<<Self::File as File>::Key> + Send + Sync + 'async_trait,
        Self: 'async_trait,
        'life0: 'async_trait
; fn try_write_block<Q>(
        &self,
        name: Q
    ) -> TCResult<<Self::File as File>::BlockWrite>
    where
        Q: Borrow<<Self::File as File>::Key> + Send + Sync
; fn read_block_owned<'async_trait, Q>(
        self,
        name: Q
    ) -> Pin<Box<dyn Future<Output = TCResult<<Self::File as File>::BlockRead>> + Send + 'async_trait>>
    where
        Q: Borrow<<Self::File as File>::Key> + Send + Sync + 'async_trait,
        Self: 'async_trait
, { ... } fn try_read_block_owned<Q>(
        self,
        name: Q
    ) -> TCResult<<Self::File as File>::BlockRead>
    where
        Q: Borrow<<Self::File as File>::Key> + Send + Sync
, { ... } }
Expand description

A read lock on a File

Required Associated Types§

The type of this File

Required Methods§

Return the set of names of each block in this File.

Return true if this File contains a block with the given name.

Return true if there are no blocks in this File.

Lock the block at name for reading.

Lock the block at name for reading synchronously, if possible.

Lock the block at name for reading exclusively, i.e. prevent any more read locks being acquired while this one is active.

Lock the block at name for reading exclusively, synchronously if possible,

Lock the block at name for writing.

Lock the block at name for writing synchronously, if possible.

Provided Methods§

Lock the block at name for reading, without borrowing.

Lock the block at name for reading, without borrowing, synchronously if possible.

Implementors§