pub struct ProvenanceTracker {
pub graph: Vec<ProvenanceNode>,
}Expand description
Directed acyclic graph for W3C-PROV-style provenance tracking.
Fields§
§graph: Vec<ProvenanceNode>Ordered list of nodes in the provenance graph.
Implementations§
Source§impl ProvenanceTracker
impl ProvenanceTracker
Sourcepub fn add_computation(
&mut self,
id: impl Into<String>,
inputs: Vec<String>,
outputs: Vec<String>,
)
pub fn add_computation( &mut self, id: impl Into<String>, inputs: Vec<String>, outputs: Vec<String>, )
Record a computation node that consumes inputs and produces outputs.
Sourcepub fn add_data_source(&mut self, id: impl Into<String>, outputs: Vec<String>)
pub fn add_data_source(&mut self, id: impl Into<String>, outputs: Vec<String>)
Record a data-source (dataset) node.
Sourcepub fn trace_lineage(&self, target_id: &str) -> Vec<String>
pub fn trace_lineage(&self, target_id: &str) -> Vec<String>
Trace the full ancestry of target_id.
Returns all node IDs that transitively contribute to target_id.
Sourcepub fn to_prov_json(&self) -> String
pub fn to_prov_json(&self) -> String
Serialise the provenance graph to a simplified PROV-JSON string.
Trait Implementations§
Source§impl Debug for ProvenanceTracker
impl Debug for ProvenanceTracker
Source§impl Default for ProvenanceTracker
impl Default for ProvenanceTracker
Source§fn default() -> ProvenanceTracker
fn default() -> ProvenanceTracker
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ProvenanceTracker
impl RefUnwindSafe for ProvenanceTracker
impl Send for ProvenanceTracker
impl Sync for ProvenanceTracker
impl Unpin for ProvenanceTracker
impl UnsafeUnpin for ProvenanceTracker
impl UnwindSafe for ProvenanceTracker
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
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.