jj_lib::op_heads_store

Trait OpHeadsStore

source
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§

source

fn as_any(&self) -> &dyn Any

source

fn name(&self) -> &str

source

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.

source

fn get_op_heads(&self) -> Vec<OperationId>

source

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.

Implementors§