pub trait EmbedBackend: Send + Sync {
// Required methods
fn dim(&self) -> usize;
fn embed(&self, text: &str) -> Result<Vec<f32>>;
// Provided method
fn model(&self) -> &str { ... }
}Expand description
Pluggable embedding backend. The host owns the model; multilingual recall quality comes from choosing a multilingual model (e.g. bge-m3 / multilingual-e5) — text reaches the backend as NFC-normalized UTF-8, script untouched (Arabic/Mandarin/English alike).
Required Methods§
Provided Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".