Skip to main content

ReplicationSink

Trait ReplicationSink 

Source
pub trait ReplicationSink: Send {
    // Required methods
    fn load_checkpoint(
        &mut self,
        job_id: &str,
    ) -> impl Future<Output = Result<Option<Checkpoint>>> + Send;
    fn save_checkpoint(
        &mut self,
        cp: &Checkpoint,
    ) -> impl Future<Output = Result<()>> + Send;
    fn begin(&mut self) -> impl Future<Output = Result<()>> + Send;
    fn relation(
        &mut self,
        rel: Arc<Relation>,
    ) -> impl Future<Output = Result<()>> + Send;
    fn apply(&mut self, op: Op) -> impl Future<Output = Result<()>> + Send;
    fn commit(
        &mut self,
        cp: &Checkpoint,
    ) -> impl Future<Output = Result<()>> + Send;
    fn rollback(&mut self) -> impl Future<Output = Result<()>> + Send;
}
Expand description

Applies transactions to a destination and persists checkpoints with them.

Required Methods§

Source

fn load_checkpoint( &mut self, job_id: &str, ) -> impl Future<Output = Result<Option<Checkpoint>>> + Send

Load the job’s checkpoint; None if the job has never been bootstrapped.

Source

fn save_checkpoint( &mut self, cp: &Checkpoint, ) -> impl Future<Output = Result<()>> + Send

Persist a checkpoint outside of any data transaction (autocommit).

Source

fn begin(&mut self) -> impl Future<Output = Result<()>> + Send

Start a destination transaction.

Source

fn relation( &mut self, rel: Arc<Relation>, ) -> impl Future<Output = Result<()>> + Send

Relation metadata; may arrive inside or outside a transaction and must be cached.

Source

fn apply(&mut self, op: Op) -> impl Future<Output = Result<()>> + Send

Apply one change inside the open transaction. Implementations may batch.

Source

fn commit(&mut self, cp: &Checkpoint) -> impl Future<Output = Result<()>> + Send

Flush pending changes, write cp, and commit atomically. After Ok, the data and the checkpoint are durable.

Source

fn rollback(&mut self) -> impl Future<Output = Result<()>> + Send

Abort the open transaction, if any. Best effort; must not panic.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§