pub trait Embedder: Send + Sync {
// Required methods
fn embed(&self, text: &str) -> Vec<f32>;
fn dim(&self) -> usize;
fn name(&self) -> &str;
// Provided methods
fn is_semantic(&self) -> bool { ... }
fn embed_batch(&self, texts: &[String]) -> Vec<Vec<f32>> { ... }
}Expand description
Backend-neutral embedding seam used by the store’s search implementation.
The deterministic lexical backend is always available. Higher-quality
implementations may be injected through StoreHooks without changing the
search interface or any transport.
Required Methods§
fn embed(&self, text: &str) -> Vec<f32>
fn dim(&self) -> usize
fn name(&self) -> &str
Provided Methods§
fn is_semantic(&self) -> bool
fn embed_batch(&self, texts: &[String]) -> Vec<Vec<f32>>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".