pub struct Provenance {
pub created_by: String,
pub created_at: String,
pub source_file: Option<String>,
pub source_line: Option<usize>,
pub modified_by: Option<String>,
pub modified_at: Option<String>,
pub derived_from: Vec<String>,
pub notes: Option<String>,
}Expand description
Provenance information tracking the origin and history of a symbol.
Fields§
§created_by: StringWho created this symbol (user, system, or tool name)
created_at: StringWhen it was created (ISO 8601 timestamp)
source_file: Option<String>Source file or location where it was defined
source_line: Option<usize>Source line number
modified_by: Option<String>Who last modified this symbol
modified_at: Option<String>When it was last modified (ISO 8601 timestamp)
derived_from: Vec<String>Derivation information (if this symbol was derived from others)
notes: Option<String>Additional provenance notes
Implementations§
Source§impl Provenance
impl Provenance
Sourcepub fn new(created_by: impl Into<String>, created_at: impl Into<String>) -> Self
pub fn new(created_by: impl Into<String>, created_at: impl Into<String>) -> Self
Creates a new provenance record.
Sourcepub fn with_source(self, file: impl Into<String>, line: Option<usize>) -> Self
pub fn with_source(self, file: impl Into<String>, line: Option<usize>) -> Self
Sets the source file location.
Sourcepub fn mark_modified(
&mut self,
modified_by: impl Into<String>,
modified_at: impl Into<String>,
)
pub fn mark_modified( &mut self, modified_by: impl Into<String>, modified_at: impl Into<String>, )
Marks this symbol as modified.
Sourcepub fn add_derivation(&mut self, source: impl Into<String>)
pub fn add_derivation(&mut self, source: impl Into<String>)
Adds a derivation source.
Sourcepub fn with_notes(self, notes: impl Into<String>) -> Self
pub fn with_notes(self, notes: impl Into<String>) -> Self
Sets provenance notes.
Trait Implementations§
Source§impl Clone for Provenance
impl Clone for Provenance
Source§fn clone(&self) -> Provenance
fn clone(&self) -> Provenance
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 Provenance
impl Debug for Provenance
Source§impl<'de> Deserialize<'de> for Provenance
impl<'de> Deserialize<'de> for Provenance
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
Source§impl Display for Provenance
impl Display for Provenance
Source§impl PartialEq for Provenance
impl PartialEq for Provenance
Source§impl Serialize for Provenance
impl Serialize for Provenance
impl StructuralPartialEq for Provenance
Auto Trait Implementations§
impl Freeze for Provenance
impl RefUnwindSafe for Provenance
impl Send for Provenance
impl Sync for Provenance
impl Unpin for Provenance
impl UnwindSafe for Provenance
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