Skip to main content

Embedder

Trait Embedder 

Source
pub trait Embedder: Send + Sync {
    // Required methods
    fn model(&self) -> &str;
    fn embed<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        texts: &'life1 [String],
        cancel: &'life2 CancellationToken,
    ) -> Pin<Box<dyn Future<Output = Result<EmbeddingOutput, MemoryError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
}

Required Methods§

Source

fn model(&self) -> &str

Source

fn embed<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, texts: &'life1 [String], cancel: &'life2 CancellationToken, ) -> Pin<Box<dyn Future<Output = Result<EmbeddingOutput, MemoryError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§