pub trait OpHeadsStore:
Send
+ Sync
+ Debug {
// Required methods
fn as_any(&self) -> &dyn Any;
fn name(&self) -> &str;
fn update_op_heads(&self, old_ids: &[OperationId], new_id: &OperationId);
fn get_op_heads(&self) -> Vec<OperationId>;
fn lock(&self) -> Box<dyn OpHeadsStoreLock + '_>;
}Expand description
Manages the set of current heads of the operation log.
Required Methods§
fn as_any(&self) -> &dyn Any
fn name(&self) -> &str
sourcefn update_op_heads(&self, old_ids: &[OperationId], new_id: &OperationId)
fn update_op_heads(&self, old_ids: &[OperationId], new_id: &OperationId)
Remove the old op heads and add the new one.
The old op heads must not contain the new one.
fn get_op_heads(&self) -> Vec<OperationId>
sourcefn lock(&self) -> Box<dyn OpHeadsStoreLock + '_>
fn lock(&self) -> Box<dyn OpHeadsStoreLock + '_>
Optionally takes a lock on the op heads store. The purpose of the lock is to prevent concurrent processes from resolving the same divergent operations. It is not needed for correctness; implementations are free to return a type that doesn’t hold.