Documentation
¶
Overview ¶
Package rustextractor provides Rust extraction with Actix/Axum/Rocket route detection.
Package rustextractor provides a tree-sitter based extractor for Rust files. It implements types.Extractor and produces declaration nodes and syntactic call/import edges without type resolution.
This extractor handles Rust-specific constructs: function items, struct/enum definitions, trait definitions (mapped to "interface" kind), impl blocks with methods, use declarations, call expressions (including scoped identifiers), macro invocations, and HTTP route detection for Actix-web, Axum, and Rocket frameworks.
All edges have provenance "ast_inferred" and confidence 0.7. The LSP enrichment pass can later upgrade confirmed edges.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RustExtractor ¶
type RustExtractor struct{}
RustExtractor implements types.Extractor for Rust files using tree-sitter AST parsing. It is AST-only with no type resolution. Thread-safe: each Extract call creates its own parser (required for concurrent use; tree-sitter parsers are not goroutine-safe).
func NewRustExtractor ¶
func NewRustExtractor() *RustExtractor
NewRustExtractor creates a new RustExtractor.
func (*RustExtractor) CanHandle ¶
func (e *RustExtractor) CanHandle(path string) bool
CanHandle returns true for .rs files that are not in the target/ directory.
func (*RustExtractor) Extract ¶
func (e *RustExtractor) Extract(ctx context.Context, opts types.ExtractOptions) (*types.ExtractResult, error)
Extract parses the Rust file with tree-sitter and produces nodes for declarations and edges for calls, imports, and routes.