Skip to main content

MemoryManager

Struct MemoryManager 

Source
pub struct MemoryManager { /* private fields */ }

Implementations§

Source§

impl MemoryManager

Source

pub async fn new( hot_cfg: HotConfig, cold_cfg: ColdConfig, flux_cfg: FluxConfig, db_path: &str, ) -> Result<Arc<Self>>

构建完整系统

Source

pub async fn insert(&self, id: String, vec: Vec<f32>) -> Result<()>

Source

pub async fn insert_batch(&self, items: Vec<(String, Vec<f32>)>) -> Result<()>

Source

pub async fn search( &self, query: Vec<f32>, k: usize, ) -> Result<Vec<SearchResult>>

搜索:热层优先,未命中时冷层粗筛+异步恢复

Source

pub async fn get_by_id(&self, id: &str) -> Result<Vec<f32>>

按ID精确获取

Source

pub async fn delete(&self, id: &str) -> Result<()>

Source

pub async fn apply_feedback(&self, id: &str, reward: f32) -> Result<()>

Source

pub async fn health(&self) -> HealthStatus

Source

pub async fn stats(&self) -> SystemStats

Source

pub async fn rebuild_nebula_index(&self) -> Result<()>

手动触发冷层分区重建

Source

pub async fn manual_descend(&self, id: &str) -> Result<()>

Source

pub async fn manual_ascend(&self, id: &str) -> Result<()>

Source

pub async fn set_temperature(&self, v: f32)

Source

pub async fn get_temperature(&self) -> f32

Source

pub fn metrics(&self) -> &Metrics

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.