pub struct MemoryEntry {
pub id: String,
pub created_at: DateTime<Utc>,
pub last_referenced: DateTime<Utc>,
pub category: MemoryCategory,
pub content: String,
pub source_session: Option<String>,
pub project_path: Option<String>,
pub reference_count: u32,
pub importance: f64,
pub tags: Vec<String>,
pub is_manual: bool,
}Expand description
A single memory entry.
Fields§
§id: StringUnique identifier.
created_at: DateTime<Utc>When the memory was created.
last_referenced: DateTime<Utc>When the memory was last accessed/referenced.
category: MemoryCategoryCategory of the memory.
content: StringThe memory content.
source_session: Option<String>Source session ID (where this memory was created).
project_path: Option<String>Project path where this memory was created.
reference_count: u32Number of times this memory has been referenced.
importance: f64Importance score (0-100, higher = more important).
Tags for searching/filtering.
is_manual: boolWhether this memory was manually added by user.
Implementations§
Source§impl MemoryEntry
impl MemoryEntry
Sourcepub fn new(
category: MemoryCategory,
content: String,
source_session: Option<String>,
project_path: Option<String>,
) -> Self
pub fn new( category: MemoryCategory, content: String, source_session: Option<String>, project_path: Option<String>, ) -> Self
Create a new memory entry.
Sourcepub fn manual(
category: MemoryCategory,
content: String,
project_path: Option<String>,
) -> Self
pub fn manual( category: MemoryCategory, content: String, project_path: Option<String>, ) -> Self
Create a manually added memory entry.
Sourcepub fn manual_global(category: MemoryCategory, content: String) -> Self
pub fn manual_global(category: MemoryCategory, content: String) -> Self
Create a manually added memory entry (global, no project path).
Sourcepub fn mark_referenced(&mut self)
pub fn mark_referenced(&mut self)
Mark this memory as referenced (increases importance over time).
Sourcepub fn mark_referenced_with_increment(&mut self, increment: f64)
pub fn mark_referenced_with_increment(&mut self, increment: f64)
Mark this memory as referenced with custom importance increment.
Sourcepub fn format_line(&self) -> String
pub fn format_line(&self) -> String
Format for display.
Sourcepub fn format_for_prompt(&self) -> String
pub fn format_for_prompt(&self) -> String
Format for inclusion in system prompt.
Trait Implementations§
Source§impl Clone for MemoryEntry
impl Clone for MemoryEntry
Source§fn clone(&self) -> MemoryEntry
fn clone(&self) -> MemoryEntry
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 MemoryEntry
impl Debug for MemoryEntry
Source§impl<'de> Deserialize<'de> for MemoryEntry
impl<'de> Deserialize<'de> for MemoryEntry
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 MemoryEntry
impl RefUnwindSafe for MemoryEntry
impl Send for MemoryEntry
impl Sync for MemoryEntry
impl Unpin for MemoryEntry
impl UnsafeUnpin for MemoryEntry
impl UnwindSafe for MemoryEntry
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