Skip to main content

TableTransaction

Trait TableTransaction 

Source
pub trait TableTransaction {
    // Required methods
    fn id(&self) -> String;
    fn lookup_rows(
        &self,
        path: &str,
        keys: &[Row],
        options: &LookupOptions,
    ) -> Result<Vec<MaybeRow>>;
    fn select_rows(
        &self,
        query: &str,
        options: &SelectOptions,
    ) -> Result<Vec<Row>>;
    fn insert_rows(&self, path: &str, rows: &[Row]) -> Result<()>;
    fn delete_rows(&self, path: &str, keys: &[Row]) -> Result<()>;
    fn ping(&self) -> Result<()>;
    fn commit(self: Box<Self>) -> Result<()>;
    fn abort(self: Box<Self>) -> Result<()>;
}
Expand description

A transaction over a dynamic table.

Dropping one does not abort it: neither transport can abort reliably from Drop, and a silent best-effort attempt would be a lie. An unfinished transaction expires on the server after its timeout.

Required Methods§

Source

fn id(&self) -> String

The transaction id, as the cluster shows it.

Source

fn lookup_rows( &self, path: &str, keys: &[Row], options: &LookupOptions, ) -> Result<Vec<MaybeRow>>

Looks rows up as of this transaction.

Source

fn select_rows(&self, query: &str, options: &SelectOptions) -> Result<Vec<Row>>

Runs a query as of this transaction.

Source

fn insert_rows(&self, path: &str, rows: &[Row]) -> Result<()>

Writes rows in this transaction.

Source

fn delete_rows(&self, path: &str, keys: &[Row]) -> Result<()>

Deletes rows by key in this transaction.

Source

fn ping(&self) -> Result<()>

Tells the server the transaction is still wanted.

Source

fn commit(self: Box<Self>) -> Result<()>

Commits. Takes the transaction by box because it consumes it.

Source

fn abort(self: Box<Self>) -> Result<()>

Aborts.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§