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§
Sourcefn load_checkpoint(
&mut self,
job_id: &str,
) -> impl Future<Output = Result<Option<Checkpoint>>> + Send
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.
Sourcefn save_checkpoint(
&mut self,
cp: &Checkpoint,
) -> impl Future<Output = Result<()>> + Send
fn save_checkpoint( &mut self, cp: &Checkpoint, ) -> impl Future<Output = Result<()>> + Send
Persist a checkpoint outside of any data transaction (autocommit).
Sourcefn begin(&mut self) -> impl Future<Output = Result<()>> + Send
fn begin(&mut self) -> impl Future<Output = Result<()>> + Send
Start a destination transaction.
Sourcefn relation(
&mut self,
rel: Arc<Relation>,
) -> impl Future<Output = Result<()>> + Send
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.
Sourcefn apply(&mut self, op: Op) -> impl Future<Output = Result<()>> + Send
fn apply(&mut self, op: Op) -> impl Future<Output = Result<()>> + Send
Apply one change inside the open transaction. Implementations may batch.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".