pub struct Memory {
pub id: String,
pub session_id: Option<String>,
pub chat_id: Option<String>,
pub memory_type: MemoryType,
pub title: String,
pub content: String,
pub tags: Vec<String>,
pub is_active: bool,
pub created_at: String,
pub updated_at: String,
}Expand description
A memory entry stored in the database.
Fields§
§id: StringUnique ID (UUID v4).
session_id: Option<String>Associated session ID (optional).
chat_id: Option<String>Associated chat ID (for Bot platforms, optional).
memory_type: MemoryTypeType of memory.
title: StringShort title for the memory (for retrieval).
content: StringFull content of the memory.
Tags for categorization and filtering.
is_active: boolSoft deletion flag.
created_at: StringISO 8601 creation timestamp.
updated_at: StringISO 8601 last update timestamp.
Implementations§
Source§impl Memory
impl Memory
Sourcepub fn new(
title: String,
content: String,
memory_type: MemoryType,
tags: Vec<String>,
) -> Self
pub fn new( title: String, content: String, memory_type: MemoryType, tags: Vec<String>, ) -> Self
Create a new memory with the given details.
Sourcepub fn with_session_id(self, session_id: String) -> Self
pub fn with_session_id(self, session_id: String) -> Self
Attach a session ID to this memory.
Sourcepub fn with_chat_id(self, chat_id: String) -> Self
pub fn with_chat_id(self, chat_id: String) -> Self
Attach a chat ID to this memory.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Memory
impl<'de> Deserialize<'de> for Memory
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 Memory
impl RefUnwindSafe for Memory
impl Send for Memory
impl Sync for Memory
impl Unpin for Memory
impl UnsafeUnpin for Memory
impl UnwindSafe for Memory
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