Skip to main content

UndoTarget

Trait UndoTarget 

Source
pub trait UndoTarget: Send + Sync {
Show 15 methods // Required methods fn delete_vertex_type(&self, label: u32) -> Result<(), UndoLogError>; fn delete_edge_type(&self, edge_key: EdgeKey) -> Result<(), UndoLogError>; fn delete_vertex( &self, vertex: VertexIdentifier, ts: u64, ) -> Result<(), UndoLogError>; fn delete_edge( &self, edge_ctx: EdgeDeletionContext, ) -> Result<(), UndoLogError>; fn undo_update_edge_property( &self, edge_id: EdgeIdentifier, col_id: ColumnId, value: Value, ts: u64, ) -> Result<(), UndoLogError>; fn revert_delete_edge( &self, edge_ctx: EdgeDeletionContext, ) -> Result<(), UndoLogError>; fn revert_delete_vertex_properties( &self, label_name: &str, prop_names: &[Arc<str>], ) -> Result<(), UndoLogError>; fn revert_delete_edge_properties( &self, src_label: &str, dst_label: &str, edge_label: &str, prop_names: &[Arc<str>], ) -> Result<(), UndoLogError>; fn revert_delete_vertex_label( &self, label_name: &str, ) -> Result<(), UndoLogError>; fn revert_delete_edge_label( &self, src_label: &str, dst_label: &str, edge_label: &str, ) -> Result<(), UndoLogError>; fn revert_rename_vertex_properties( &self, label_name: &str, current_names: &[Arc<str>], original_names: &[Arc<str>], ) -> Result<(), UndoLogError>; fn revert_rename_edge_properties( &self, src_label: &str, dst_label: &str, edge_label: &str, current_names: &[Arc<str>], original_names: &[Arc<str>], ) -> Result<(), UndoLogError>; fn staged_write_mark( &self, txn_id: TransactionId, ) -> Option<StagedWriteMark>; fn rollback_staged_writes( &self, txn_id: TransactionId, mark: StagedWriteMark, ) -> Result<(), UndoLogError>; // Provided method fn restore_edge( &self, _edge: EdgeIdentifier, _properties: Vec<(Arc<str>, Value)>, _ts: u64, ) -> Result<(), UndoLogError> { ... }
}
Expand description

Target for undo operations

Required Methods§

Source

fn delete_vertex_type(&self, label: u32) -> Result<(), UndoLogError>

Source

fn delete_edge_type(&self, edge_key: EdgeKey) -> Result<(), UndoLogError>

Source

fn delete_vertex( &self, vertex: VertexIdentifier, ts: u64, ) -> Result<(), UndoLogError>

Source

fn delete_edge(&self, edge_ctx: EdgeDeletionContext) -> Result<(), UndoLogError>

Source

fn undo_update_edge_property( &self, edge_id: EdgeIdentifier, col_id: ColumnId, value: Value, ts: u64, ) -> Result<(), UndoLogError>

Source

fn revert_delete_edge( &self, edge_ctx: EdgeDeletionContext, ) -> Result<(), UndoLogError>

Source

fn revert_delete_vertex_properties( &self, label_name: &str, prop_names: &[Arc<str>], ) -> Result<(), UndoLogError>

Source

fn revert_delete_edge_properties( &self, src_label: &str, dst_label: &str, edge_label: &str, prop_names: &[Arc<str>], ) -> Result<(), UndoLogError>

Source

fn revert_delete_vertex_label( &self, label_name: &str, ) -> Result<(), UndoLogError>

Source

fn revert_delete_edge_label( &self, src_label: &str, dst_label: &str, edge_label: &str, ) -> Result<(), UndoLogError>

Source

fn revert_rename_vertex_properties( &self, label_name: &str, current_names: &[Arc<str>], original_names: &[Arc<str>], ) -> Result<(), UndoLogError>

Source

fn revert_rename_edge_properties( &self, src_label: &str, dst_label: &str, edge_label: &str, current_names: &[Arc<str>], original_names: &[Arc<str>], ) -> Result<(), UndoLogError>

Source

fn staged_write_mark(&self, txn_id: TransactionId) -> Option<StagedWriteMark>

Capture this target’s staged-write boundary for txn_id.

Returns None when the target holds no staged writes for the transaction. Targets that stage uncommitted writes outside the undo log must override this and Self::rollback_staged_writes; every other implementor reports None.

Source

fn rollback_staged_writes( &self, txn_id: TransactionId, mark: StagedWriteMark, ) -> Result<(), UndoLogError>

Rewind staged writes of txn_id to a mark previously captured by Self::staged_write_mark.

Called only with marks this target produced. An all-zero mark is a no-op; anything else a non-staging target receives is rejected loudly instead of leaving staged rows behind.

Provided Methods§

Source

fn restore_edge( &self, _edge: EdgeIdentifier, _properties: Vec<(Arc<str>, Value)>, _ts: u64, ) -> Result<(), UndoLogError>

Restore an edge that was deleted by a transaction.

Implementations that cannot restore full edge properties may keep the default error and reject undo rather than silently losing data.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§