Struct loro_internal::oplog::AppDag
source · pub struct AppDag { /* private fields */ }Expand description
AppDag maintains the causal graph of the app. It’s faster to answer the question like what’s the LCA version
Implementations§
source§impl AppDag
impl AppDag
sourcepub fn get_vv(&self, id: ID) -> Option<ImVersionVector>
pub fn get_vv(&self, id: ID) -> Option<ImVersionVector>
get the version vector for a certain op. It’s the version when the op is applied
sourcepub fn cmp_version(&self, a: ID, b: ID) -> Option<Ordering>
pub fn cmp_version(&self, a: ID, b: ID) -> Option<Ordering>
Compare the causal order of two versions. If None, two versions are concurrent to each other
pub fn get_lamport(&self, id: &ID) -> Option<Lamport>
sourcepub fn frontiers_to_vv(&self, frontiers: &Frontiers) -> Option<VersionVector>
pub fn frontiers_to_vv(&self, frontiers: &Frontiers) -> Option<VersionVector>
Convert a frontiers to a version vector
If the frontiers version is not found in the dag, return None
pub fn vv_to_frontiers(&self, vv: &VersionVector) -> Frontiers
pub fn get_frontiers(&self) -> &Frontiers
sourcepub fn cmp_frontiers(&self, other: &Frontiers) -> Ordering
pub fn cmp_frontiers(&self, other: &Frontiers) -> Ordering
- Ordering::Less means self is less than target or parallel
- Ordering::Equal means versions equal
- Ordering::Greater means self’s version is greater than target
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for AppDag
impl Send for AppDag
impl Sync for AppDag
impl Unpin for AppDag
impl UnwindSafe for AppDag
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more