pub enum Backend {
Sqlite(SqliteBackend),
}Expand description
Runtime backend dispatcher.
Wraps either SqliteBackend or NativeV3Backend and delegates Backend trait methods to the appropriate implementation based on database format detection.
Variants§
Sqlite(SqliteBackend)
SQLite storage backend (traditional, always available)
Implementations§
Source§impl Backend
impl Backend
Sourcepub fn detect_and_open(db_path: &Path) -> Result<Self, LlmError>
pub fn detect_and_open(db_path: &Path) -> Result<Self, LlmError>
Detect backend format from database file and open appropriate backend.
Checks file header magic bytes to distinguish between:
- V3 backend: “SQLTGF” header (SQLiteGraph native format)
- SQLite backend: “SQLite format 3\0” header
§Arguments
db_path- Path to the database file
§Returns
Ok(Backend)- Appropriate backend variant based on file header detectionErr(LlmError::NativeV3BackendNotSupported)- Native-V3 detected but feature not enabledErr(LlmError::BackendDetectionFailed)- Detection failed
Sourcepub fn search_symbols(
&self,
options: SearchOptions<'_>,
) -> Result<(SearchResponse, bool, bool), LlmError>
pub fn search_symbols( &self, options: SearchOptions<'_>, ) -> Result<(SearchResponse, bool, bool), LlmError>
Delegate search_symbols to inner backend.
Sourcepub fn search_references(
&self,
options: SearchOptions<'_>,
) -> Result<(ReferenceSearchResponse, bool), LlmError>
pub fn search_references( &self, options: SearchOptions<'_>, ) -> Result<(ReferenceSearchResponse, bool), LlmError>
Delegate search_references to inner backend.
Sourcepub fn search_calls(
&self,
options: SearchOptions<'_>,
) -> Result<(CallSearchResponse, bool), LlmError>
pub fn search_calls( &self, options: SearchOptions<'_>, ) -> Result<(CallSearchResponse, bool), LlmError>
Delegate search_calls to inner backend.
Sourcepub fn ast(
&self,
file: &Path,
position: Option<usize>,
limit: usize,
) -> Result<Value, LlmError>
pub fn ast( &self, file: &Path, position: Option<usize>, limit: usize, ) -> Result<Value, LlmError>
Delegate ast to inner backend.
Sourcepub fn find_ast(&self, kind: &str) -> Result<Value, LlmError>
pub fn find_ast(&self, kind: &str) -> Result<Value, LlmError>
Delegate find_ast to inner backend.
Sourcepub fn complete(
&self,
prefix: &str,
limit: usize,
) -> Result<Vec<String>, LlmError>
pub fn complete( &self, prefix: &str, limit: usize, ) -> Result<Vec<String>, LlmError>
Get FQN completions for a prefix.
This method is only available with native-v3 backend. SQLite backend returns RequiresNativeV3Backend error.
Sourcepub fn lookup(&self, fqn: &str, db_path: &str) -> Result<SymbolMatch, LlmError>
pub fn lookup(&self, fqn: &str, db_path: &str) -> Result<SymbolMatch, LlmError>
Lookup symbol by exact FQN.
This method is only available with native-v3 backend. SQLite backend returns RequiresNativeV3Backend error.
Sourcepub fn search_by_label(
&self,
label: &str,
limit: usize,
db_path: &str,
) -> Result<(SearchResponse, bool, bool), LlmError>
pub fn search_by_label( &self, label: &str, limit: usize, db_path: &str, ) -> Result<(SearchResponse, bool, bool), LlmError>
Search for symbols by label.
This method is only available with native-v3 backend. SQLite backend returns RequiresNativeV3Backend error.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Backend
impl !RefUnwindSafe for Backend
impl Send for Backend
impl !Sync for Backend
impl Unpin for Backend
impl !UnwindSafe for Backend
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more