pub struct MemoryProvenanceRecord {
pub id: Option<Thing>,
pub memory_id: String,
pub source_type: String,
pub source_data: Value,
pub derived_from: Option<String>,
pub created_at: DateTime<Utc>,
pub invalidated_at: Option<DateTime<Utc>>,
}Expand description
Memory provenance record - tracks lineage of memories
Fields§
§id: Option<Thing>SurrealDB record ID
memory_id: StringThe memory ID this provenance describes
source_type: StringSource type (JSON serialized ProvenanceSourceType)
source_data: ValueSource details (JSON: run_id, event_idx, commit_id, user_id, parent_id, etc.)
derived_from: Option<String>Parent memory ID if derived
created_at: DateTime<Utc>Created timestamp
invalidated_at: Option<DateTime<Utc>>When this provenance became invalid/stale
Implementations§
Source§impl MemoryProvenanceRecord
impl MemoryProvenanceRecord
Sourcepub fn from_run_trace(
memory_id: String,
run_id: String,
event_idx: usize,
) -> Self
pub fn from_run_trace( memory_id: String, run_id: String, event_idx: usize, ) -> Self
Create provenance for a run trace source
Sourcepub fn from_snapshot(memory_id: String, commit_id: String) -> Self
pub fn from_snapshot(memory_id: String, commit_id: String) -> Self
Create provenance for a state snapshot source
Sourcepub fn from_user_annotation(memory_id: String, user_id: String) -> Self
pub fn from_user_annotation(memory_id: String, user_id: String) -> Self
Create provenance for user annotation
Sourcepub fn from_derivation(
memory_id: String,
parent_id: String,
derivation: String,
) -> Self
pub fn from_derivation( memory_id: String, parent_id: String, derivation: String, ) -> Self
Create provenance for derived memory
Sourcepub fn invalidate(self) -> Self
pub fn invalidate(self) -> Self
Mark this provenance as invalidated
Trait Implementations§
Source§impl Clone for MemoryProvenanceRecord
impl Clone for MemoryProvenanceRecord
Source§fn clone(&self) -> MemoryProvenanceRecord
fn clone(&self) -> MemoryProvenanceRecord
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 MemoryProvenanceRecord
impl Debug for MemoryProvenanceRecord
Source§impl<'de> Deserialize<'de> for MemoryProvenanceRecord
impl<'de> Deserialize<'de> for MemoryProvenanceRecord
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 MemoryProvenanceRecord
impl RefUnwindSafe for MemoryProvenanceRecord
impl Send for MemoryProvenanceRecord
impl Sync for MemoryProvenanceRecord
impl Unpin for MemoryProvenanceRecord
impl UnsafeUnpin for MemoryProvenanceRecord
impl UnwindSafe for MemoryProvenanceRecord
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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more