pub struct TimelineDag {
pub branches: Vec<TimelineBranch>,
}Expand description
A timeline DAG — directed acyclic graph of timeline branches (OCS §6).
Fields§
§branches: Vec<TimelineBranch>All branches in this DAG, keyed by branch_id
Implementations§
Source§impl TimelineDag
impl TimelineDag
Sourcepub fn new(prime: TimelineBranch) -> Self
pub fn new(prime: TimelineBranch) -> Self
Creates a new TimelineDag.
Sourcepub fn add_branch(&mut self, branch: TimelineBranch) -> bool
pub fn add_branch(&mut self, branch: TimelineBranch) -> bool
Add a divergent branch (OCS §6.1). Returns false if the parent doesn’t exist or would create a cycle.
Sourcepub fn children_of(&self, parent_id: &str) -> Vec<&TimelineBranch>
pub fn children_of(&self, parent_id: &str) -> Vec<&TimelineBranch>
Get all child branches of a given parent.
Sourcepub fn ancestry(&self, branch_id: &str) -> Vec<&TimelineBranch>
pub fn ancestry(&self, branch_id: &str) -> Vec<&TimelineBranch>
Get the full ancestry chain of a branch (root → … → branch).
Sourcepub fn verify_branch_isolation(&self, branch_id: &str) -> bool
pub fn verify_branch_isolation(&self, branch_id: &str) -> bool
Verify that divergent branches don’t mutate parent timeline records (OCS-T09).
Sourcepub fn prime(&self) -> Option<&TimelineBranch>
pub fn prime(&self) -> Option<&TimelineBranch>
Get the prime (root) timeline.
Trait Implementations§
Source§impl Clone for TimelineDag
impl Clone for TimelineDag
Auto Trait Implementations§
impl Freeze for TimelineDag
impl RefUnwindSafe for TimelineDag
impl Send for TimelineDag
impl Sync for TimelineDag
impl Unpin for TimelineDag
impl UnsafeUnpin for TimelineDag
impl UnwindSafe for TimelineDag
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