Skip to main content

TransactionAction

Trait TransactionAction 

Source
pub trait TransactionAction:
    AsAny
    + Sync
    + Send {
    // Required method
    fn commit<'life0, 'async_trait>(
        self: Arc<Self>,
        table: &'life0 Table,
    ) -> Pin<Box<dyn Future<Output = Result<ActionCommit>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

A trait representing an atomic action that can be part of a transaction.

Implementors of this trait define how a specific action is committed to a table. Each action is responsible for generating the updates and requirements needed to modify the table metadata.

Required Methods§

Source

fn commit<'life0, 'async_trait>( self: Arc<Self>, table: &'life0 Table, ) -> Pin<Box<dyn Future<Output = Result<ActionCommit>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Commits this action against the provided table and returns the resulting updates. NOTE: Most users should apply actions through Transaction, which handles rebasing onto the latest table state and retrying on commit conflicts. Call this directly only to take over that responsibility yourself, passing the resulting updates and requirements to Catalog::update_table via TableCommit.

§Arguments
  • table - The current state of the table this action should apply to.
§Returns

An ActionCommit containing table updates and table requirements, or an error if the commit fails.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§