Skip to main content

ExampleSelector

Trait ExampleSelector 

Source
pub trait ExampleSelector: Send + Sync {
    // Required methods
    fn select_examples<'life0, 'life1, 'async_trait>(
        &'life0 self,
        query: &'life1 str,
        top_k: usize,
    ) -> Pin<Box<dyn Future<Output = Layer3Result<Vec<Example>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn add_example<'life0, 'async_trait>(
        &'life0 self,
        example: Example,
    ) -> Pin<Box<dyn Future<Output = Layer3Result<bool>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn count<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = usize> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

示例选择器 trait

定义示例选择接口。

Required Methods§

Source

fn select_examples<'life0, 'life1, 'async_trait>( &'life0 self, query: &'life1 str, top_k: usize, ) -> Pin<Box<dyn Future<Output = Layer3Result<Vec<Example>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

选择示例

Source

fn add_example<'life0, 'async_trait>( &'life0 self, example: Example, ) -> Pin<Box<dyn Future<Output = Layer3Result<bool>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

添加示例

Source

fn count<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = usize> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

获取所有示例数量

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§