/** * SMI-1306: Rust Language Adapter * * Parses Rust source files (.rs) and extracts imports, exports, and functions * using regex-based parsing. Rust uses explicit `pub` visibility modifiers * for public items. * * @see docs/internal/architecture/multi-language-analysis.md */ import { LanguageAdapter, type SupportedLanguage } from './base.js'; import type { ParseResult, ExportInfo, FunctionInfo, FrameworkRule } from './base.js'; export { parseCargoToml, type CargoDependency } from './rust-parsers.js'; /** * Extended ExportInfo for Rust with visibility support */ export interface RustExportInfo extends ExportInfo { /** Rust exports via pub modifier */ visibility: 'public' | 'private'; /** Line number in source */ line: number; } /** * Extended FunctionInfo for Rust with attribute support */ export interface RustFunctionInfo extends FunctionInfo { /** Rust attributes (e.g., #[derive], #[test]) */ attributes?: string[]; } /** * Rust Language Adapter * * Parses Rust source files using regex-based parsing. * Handles Rust's `pub` visibility modifiers and module system. * * @example * ```typescript * const adapter = new RustAdapter() * const result = adapter.parseFile(rustCode, 'lib.rs') * console.log(result.exports) // Items with pub modifier * ``` */ export declare class RustAdapter extends LanguageAdapter { readonly language: SupportedLanguage; readonly extensions: string[]; /** * Parse a Rust source file and extract information */ parseFile(content: string, filePath: string): ParseResult; /** * Parse file incrementally (currently same as full parse) */ parseIncremental(content: string, filePath: string, _previousTree?: unknown): ParseResult; /** * Get Rust framework detection rules */ getFrameworkRules(): FrameworkRule[]; /** * Clean up resources (no-op for regex-based parsing) */ dispose(): void; /** * Extract use statements from Rust source */ private extractImports; /** * Extract exports (pub items) from Rust source */ private extractExports; /** * Extract function definitions from Rust source */ private extractFunctions; } //# sourceMappingURL=rust.d.ts.map