Skip to main content

RerankCache

Trait RerankCache 

Source
pub trait RerankCache:
    Send
    + Sync
    + Debug {
    // Required methods
    fn get<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        query: &'life1 str,
        candidate_ids: &'life2 [String],
    ) -> Pin<Box<dyn Future<Output = Option<RerankResult>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn set<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        query: &'life1 str,
        candidate_ids: &'life2 [String],
        result: &'life3 RerankResult,
        ttl: Duration,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait;
}
Expand description

Rerank 结果缓存

Required Methods§

Source

fn get<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, query: &'life1 str, candidate_ids: &'life2 [String], ) -> Pin<Box<dyn Future<Output = Option<RerankResult>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

获取缓存结果

Source

fn set<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, query: &'life1 str, candidate_ids: &'life2 [String], result: &'life3 RerankResult, ttl: Duration, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

存储缓存结果

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§