Struct tinychain::fs::File [−][src]
pub struct File<B> { /* fields omitted */ }
Expand description
A transactional file
Implementations
Trait Implementations
Borrow this instance as an instance of T
if possible.
Borrow this instance mutably as an instance of T
if possible.
Convert this instance into an instance of T
if possible.
Borrow this instance mutably as an instance of T
if possible.
Borrow this instance mutably as an instance of T
if possible.
type Read = FileReadGuard<CacheBlock, B>
type Read = FileReadGuard<CacheBlock, B>
A read Lock on a block in this file.
type Write = FileWriteGuard<CacheBlock, B>
type Write = FileWriteGuard<CacheBlock, B>
A read Lock on a block in this file.
Return the IDs of all this File
’s blocks.
Copy all blocks from the source File
into this File
.
Create a new block. Read more
Create a new block. Read more
Delete the block with the given ID.
fn read_block<'life0, 'async_trait>(
&'life0 self,
txn_id: TxnId,
block_id: BlockId
) -> Pin<Box<dyn Future<Output = TCResult<FileReadGuard<CacheBlock, B>>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn read_block<'life0, 'async_trait>(
&'life0 self,
txn_id: TxnId,
block_id: BlockId
) -> Pin<Box<dyn Future<Output = TCResult<FileReadGuard<CacheBlock, B>>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Get a read lock on the block at name
.
fn read_block_owned<'async_trait>(
self,
txn_id: TxnId,
block_id: BlockId
) -> Pin<Box<dyn Future<Output = TCResult<FileReadGuard<CacheBlock, B>>> + Send + 'async_trait>> where
Self: 'async_trait,
fn read_block_owned<'async_trait>(
self,
txn_id: TxnId,
block_id: BlockId
) -> Pin<Box<dyn Future<Output = TCResult<FileReadGuard<CacheBlock, B>>> + Send + 'async_trait>> where
Self: 'async_trait,
Get a read lock on the block at name
, without borrowing.
fn write_block<'life0, 'async_trait>(
&'life0 self,
txn_id: TxnId,
block_id: BlockId
) -> Pin<Box<dyn Future<Output = TCResult<FileWriteGuard<CacheBlock, B>>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn write_block<'life0, 'async_trait>(
&'life0 self,
txn_id: TxnId,
block_id: BlockId
) -> Pin<Box<dyn Future<Output = TCResult<FileWriteGuard<CacheBlock, B>>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Get a read lock on the block at name
as of TxnId
.
Performs the conversion.
Commit this transaction.
Auto Trait Implementations
impl<B> !RefUnwindSafe for File<B>
impl<B> !UnwindSafe for File<B>
Blanket Implementations
Mutably borrows from an owned value. Read more
Returns true
if self
can be cast into the target type T
.
Test if value
can be cast into Self
.
Returns Some(Self)
if the source value can be cast into Self
, otherwise None
.
fn try_cast_from<Err, OnErr>(value: T, on_err: OnErr) -> Result<Self, Err> where
OnErr: FnOnce(&T) -> Err,
fn try_cast_from<Err, OnErr>(value: T, on_err: OnErr) -> Result<Self, Err> where
OnErr: FnOnce(&T) -> Err,
Returns Ok(Self)
if the source value can be cast into Self
, otherwise calls on_err
.
Test if self
can be cast into T
.
Returns Some(T)
if self
can be cast into T
, otherwise None
.
fn try_cast_into<Err, OnErr>(self, on_err: OnErr) -> Result<T, Err> where
OnErr: FnOnce(&Self) -> Err,
fn try_cast_into<Err, OnErr>(self, on_err: OnErr) -> Result<T, Err> where
OnErr: FnOnce(&Self) -> Err,
Returns Ok(T)
if self
can be cast into T
, otherwise calls on_err
.
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more