pub struct MemorySystem { /* private fields */ }Expand description
Unified memory system interface
Implementations§
Source§impl MemorySystem
impl MemorySystem
Sourcepub async fn new(config: MemoryConfig) -> Result<Self>
pub async fn new(config: MemoryConfig) -> Result<Self>
Create new memory system
Sourcepub async fn get(&self, namespace: &str, key: &str) -> Result<Option<Vec<u8>>>
pub async fn get(&self, namespace: &str, key: &str) -> Result<Option<Vec<u8>>>
Get from memory (tries L1 -> L2 -> L3)
Sourcepub async fn put(
&self,
namespace: &str,
key: &str,
value: Vec<u8>,
) -> Result<()>
pub async fn put( &self, namespace: &str, key: &str, value: Vec<u8>, ) -> Result<()>
Store in memory (writes to all tiers)
Sourcepub async fn search_similar(
&self,
namespace: &str,
query_embedding: Vec<f32>,
top_k: usize,
) -> Result<Vec<(String, f32)>>
pub async fn search_similar( &self, namespace: &str, query_embedding: Vec<f32>, top_k: usize, ) -> Result<Vec<(String, f32)>>
Semantic search using L2 vector store
Sourcepub async fn track_trajectory(&self, trajectory: Trajectory) -> Result<()>
pub async fn track_trajectory(&self, trajectory: Trajectory) -> Result<()>
Track agent trajectory
Sourcepub async fn subscribe(&self, topic: &str) -> Result<Receiver<Vec<u8>>>
pub async fn subscribe(&self, topic: &str) -> Result<Receiver<Vec<u8>>>
Subscribe to agent messages
Sourcepub async fn publish(&self, topic: &str, message: Vec<u8>) -> Result<()>
pub async fn publish(&self, topic: &str, message: Vec<u8>) -> Result<()>
Publish message to agents
Sourcepub async fn acquire_lock(
&self,
resource: &str,
timeout: Duration,
) -> Result<String>
pub async fn acquire_lock( &self, resource: &str, timeout: Duration, ) -> Result<String>
Acquire distributed lock
Sourcepub async fn release_lock(&self, token: &str) -> Result<()>
pub async fn release_lock(&self, token: &str) -> Result<()>
Release distributed lock
Sourcepub fn stats(&self) -> MemoryStats
pub fn stats(&self) -> MemoryStats
Get memory statistics
Auto Trait Implementations§
impl !Freeze for MemorySystem
impl !RefUnwindSafe for MemorySystem
impl Send for MemorySystem
impl Sync for MemorySystem
impl Unpin for MemorySystem
impl !UnwindSafe for MemorySystem
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