Module backend_factory

Module backend_factory 

Source
Expand description

Backend factory for storage layer initialization.

This module centralizes backend creation to:

  • Reduce code duplication between for_repo and for_user
  • Enable easier backend swapping for testing
  • Provide consistent error handling and graceful degradation

§Architecture

BackendFactory
  ├── create_embedder() → Arc<dyn Embedder>
  ├── create_index_backend() → Option<Arc<dyn IndexBackend>>
  └── create_vector_backend() → Option<Arc<dyn VectorBackend>>

§Graceful Degradation

Factory methods return Option for backends that may fail to initialize. This allows the service container to continue with reduced functionality.

Structs§

BackendFactory
Factory for creating storage backends.
BackendSet
Result of backend initialization with optional components.