pub struct StateTopology { /* private fields */ }Expand description
Topology tracker for state revisions
Implementations§
Source§impl StateTopology
impl StateTopology
pub fn new() -> Self
Sourcepub fn add_revision(&mut self, revision: StateRevision)
pub fn add_revision(&mut self, revision: StateRevision)
Add revision to topology
Sourcepub fn get(&self, id: &StateId) -> Option<&StateRevision>
pub fn get(&self, id: &StateId) -> Option<&StateRevision>
Get revision by id
Sourcepub fn is_ancestor(&self, a: &StateId, b: &StateId) -> bool
pub fn is_ancestor(&self, a: &StateId, b: &StateId) -> bool
Check if A is ancestor of B
Sourcepub fn ancestors(&self, id: &StateId) -> Vec<StateId>
pub fn ancestors(&self, id: &StateId) -> Vec<StateId>
Get all ancestors of a revision (excluding self)
Sourcepub fn common_ancestor(&self, a: &StateId, b: &StateId) -> Option<StateId>
pub fn common_ancestor(&self, a: &StateId, b: &StateId) -> Option<StateId>
Find common ancestor of two revisions
Sourcepub fn relationship(&self, a: &StateId, b: &StateId) -> Relationship
pub fn relationship(&self, a: &StateId, b: &StateId) -> Relationship
Determine relationship between two revisions
Auto Trait Implementations§
impl Freeze for StateTopology
impl RefUnwindSafe for StateTopology
impl Send for StateTopology
impl Sync for StateTopology
impl Unpin for StateTopology
impl UnsafeUnpin for StateTopology
impl UnwindSafe for StateTopology
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