pub struct MemoryManager { /* private fields */ }Implementations§
Source§impl MemoryManager
impl MemoryManager
Sourcepub async fn new(
hot_cfg: HotConfig,
cold_cfg: ColdConfig,
flux_cfg: FluxConfig,
db_path: &str,
) -> Result<Arc<Self>>
pub async fn new( hot_cfg: HotConfig, cold_cfg: ColdConfig, flux_cfg: FluxConfig, db_path: &str, ) -> Result<Arc<Self>>
构建完整系统
pub async fn insert(&self, id: String, vec: Vec<f32>) -> Result<()>
pub async fn insert_batch(&self, items: Vec<(String, Vec<f32>)>) -> Result<()>
Sourcepub async fn search(
&self,
query: Vec<f32>,
k: usize,
) -> Result<Vec<SearchResult>>
pub async fn search( &self, query: Vec<f32>, k: usize, ) -> Result<Vec<SearchResult>>
搜索:热层优先,未命中时冷层粗筛+异步恢复
pub async fn delete(&self, id: &str) -> Result<()>
pub async fn apply_feedback(&self, id: &str, reward: f32) -> Result<()>
pub async fn health(&self) -> HealthStatus
pub async fn stats(&self) -> SystemStats
Sourcepub async fn rebuild_nebula_index(&self) -> Result<()>
pub async fn rebuild_nebula_index(&self) -> Result<()>
手动触发冷层分区重建
pub async fn manual_descend(&self, id: &str) -> Result<()>
pub async fn manual_ascend(&self, id: &str) -> Result<()>
pub async fn set_temperature(&self, v: f32)
pub async fn get_temperature(&self) -> f32
pub fn metrics(&self) -> &Metrics
Auto Trait Implementations§
impl Freeze for MemoryManager
impl !RefUnwindSafe for MemoryManager
impl Send for MemoryManager
impl Sync for MemoryManager
impl Unpin for MemoryManager
impl UnsafeUnpin for MemoryManager
impl !UnwindSafe for MemoryManager
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