Skip to main content

brainwires_storage/databases/
capabilities.rs

1//! Backend capability declarations.
2//!
3//! [`BackendCapabilities`] lets callers discover what a database backend
4//! supports at runtime (e.g. whether vector search is available).
5
6/// Describes the capabilities of a database backend.
7///
8/// Backends that implement [`StorageBackend`](super::traits::StorageBackend)
9/// can override the default [`StorageBackend::capabilities`] method to
10/// advertise what they support.
11#[derive(Debug, Clone, Copy, PartialEq, Eq)]
12pub struct BackendCapabilities {
13    /// Whether the backend supports vector similarity search.
14    ///
15    /// Backends without native vector support (e.g. MySQL) should return
16    /// `false` here; calling `vector_search` on them will return an error.
17    pub vector_search: bool,
18}
19
20impl Default for BackendCapabilities {
21    fn default() -> Self {
22        Self {
23            vector_search: true,
24        }
25    }
26}