vestige/crates
Jan De Landtsheer 194fc6e4c0 feat(embedder): swap async-trait for trait_variant + dyn adapter (0001c)
Mirror of the 0001a pattern for the Embedder side.

- embedder/mod.rs: LocalEmbedder is the source trait declared with native
  async-fn-in-trait. #[trait_variant::make(EmbedderSend: Send)] derives the
  Send-bounded variant that backends implement. A hand-written Embedder
  trait wraps each async method in BoxedEmbedderFuture<'a, T> and forwards
  sync methods through a blanket impl<T: EmbedderSend> Embedder for T, so
  Box<dyn Embedder> / Arc<dyn Embedder> stay dyn-safe -- trait_variant 0.1
  alone does NOT produce a dyn-safe variant (RPITIT), so the hand-written
  adapter is required.
- embedder/fastembed.rs: drop the #[async_trait::async_trait] attribute and
  retarget the impl block to EmbedderSend. Adjust the top-level use to
  bring EmbedderSend into scope (also keeps fastembed::tests' use super::*
  trait lookups working).
- lib.rs: export EmbedderSend alongside the existing Embedder /
  LocalEmbedder re-exports.

The async-trait Cargo dependency is dropped in a follow-up commit so the
manifest change stays visible on its own.

Verification: cargo test -p vestige-core --features embeddings,vector-search
(428) and --no-default-features (370) both green. cargo test --test
embedder_trait green (2/2 including Box<dyn Embedder> cast). cargo build
--workspace --release green. cargo clippy --workspace --features
embeddings,vector-search -- -D warnings clean. grep -rn async_trait crates/
returns zero.
2026-06-18 19:08:52 -05:00
..
vestige-core feat(embedder): swap async-trait for trait_variant + dyn adapter (0001c) 2026-06-18 19:08:52 -05:00
vestige-mcp Fix ComposedGraph clippy warnings 2026-06-18 16:08:51 -05:00