/** * Rust Language Index Module * * Provides Rust-aware code search using: * - AST parsing via tree-sitter (with regex fallback) * - Local text embeddings for semantic similarity * - BM25 keyword matching for fast filtering * * Supported file types: .rs * * Index location: .raggrep/index/language/rust/ */ import { IndexModule, IndexContext, SearchContext, SearchOptions, FileIndex, SearchResult, ModuleConfig } from "../../../types"; /** Default minimum similarity score for search results */ export declare const DEFAULT_MIN_SCORE = 0.15; /** Default number of results to return */ export declare const DEFAULT_TOP_K = 10; /** File extensions supported by this module */ export declare const RUST_EXTENSIONS: string[]; /** * Check if a file is supported by this module. */ export declare function isRustFile(filepath: string): boolean; export declare const supportsFile: typeof isRustFile; /** * Module-specific data stored alongside file index. */ export interface RustModuleData { embeddings: number[][]; embeddingModel: string; [key: string]: unknown; } export declare class RustModule implements IndexModule { readonly id = "language/rust"; readonly name = "Rust Search"; readonly description = "Rust-aware code search with AST parsing and semantic embeddings"; readonly version = "1.0.0"; supportsFile(filepath: string): boolean; private embeddingConfig; private symbolicIndex; private literalIndex; private pendingSummaries; private pendingLiterals; private rootDir; private logger; initialize(config: ModuleConfig): Promise; indexFile(filepath: string, content: string, ctx: IndexContext): Promise; /** * Regex-based fallback parser for Rust. */ private parseRustRegex; /** * Create file index from parsed chunks. */ private createFileIndex; finalize(ctx: IndexContext): Promise; search(query: string, ctx: SearchContext, options?: SearchOptions): Promise; }