Skip to main content

Embedder

Trait Embedder 

Source
pub trait Embedder: Send + Sync {
    // Required methods
    fn id(&self) -> &'static str;
    fn dim(&self) -> usize;
    fn model_name(&self) -> &str;
    fn embed(&mut self, texts: &[String]) -> Result<Vec<Vec<f32>>>;
}

Required Methods§

Source

fn id(&self) -> &'static str

Source

fn dim(&self) -> usize

Source

fn model_name(&self) -> &str

Source

fn embed(&mut self, texts: &[String]) -> Result<Vec<Vec<f32>>>

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§

Source§

impl Embedder for DummyEmbedder

Source§

impl Embedder for FastEmbedder

Available on crate feature fastembed only.