pub struct OperationGraph {
pub version: u32,
pub operations: HashMap<String, Operation>,
pub roots: Vec<String>,
pub head: Option<String>,
}Expand description
Persistent operation graph (DAG)
Fields§
§version: u32Graph version for future migrations
operations: HashMap<String, Operation>All operations indexed by ID
roots: Vec<String>Root operations (no parent)
head: Option<String>Latest operation ID (head)
Implementations§
Source§impl OperationGraph
impl OperationGraph
pub fn new() -> Self
Sourcepub fn add_operation(&mut self, operation: Operation)
pub fn add_operation(&mut self, operation: Operation)
Add an operation to the graph
Sourcepub fn get_operation(&self, id: &str) -> Option<&Operation>
pub fn get_operation(&self, id: &str) -> Option<&Operation>
Get an operation by ID
Sourcepub fn operations_chronological(&self) -> Vec<&Operation>
pub fn operations_chronological(&self) -> Vec<&Operation>
Get all operations in chronological order
Sourcepub fn operations_reverse_chronological(&self) -> Vec<&Operation>
pub fn operations_reverse_chronological(&self) -> Vec<&Operation>
Get operations in reverse chronological order
Sourcepub fn get_ancestry(&self, id: &str) -> Vec<&Operation>
pub fn get_ancestry(&self, id: &str) -> Vec<&Operation>
Get the ancestry chain from an operation back to root
Sourcepub fn get_children(&self, id: &str) -> Vec<&Operation>
pub fn get_children(&self, id: &str) -> Vec<&Operation>
Get children of an operation
Sourcepub fn find_by_checkpoint(&self, checkpoint_id: &str) -> Option<&Operation>
pub fn find_by_checkpoint(&self, checkpoint_id: &str) -> Option<&Operation>
Find operation by checkpoint ID
Sourcepub fn remove_operation_tree(&mut self, id: &str) -> Vec<Operation>
pub fn remove_operation_tree(&mut self, id: &str) -> Vec<Operation>
Remove an operation and its descendants
Trait Implementations§
Source§impl Clone for OperationGraph
impl Clone for OperationGraph
Source§fn clone(&self) -> OperationGraph
fn clone(&self) -> OperationGraph
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for OperationGraph
impl Debug for OperationGraph
Source§impl Default for OperationGraph
impl Default for OperationGraph
Source§fn default() -> OperationGraph
fn default() -> OperationGraph
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for OperationGraph
impl<'de> Deserialize<'de> for OperationGraph
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for OperationGraph
impl RefUnwindSafe for OperationGraph
impl Send for OperationGraph
impl Sync for OperationGraph
impl Unpin for OperationGraph
impl UnwindSafe for OperationGraph
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