Expand description
§codegraph-rust
Rust parser for CodeGraph - extracts code entities and relationships from Rust source files.
§Features
- Parse Rust source files and extract functions, structs, enums, traits, and modules
- Track relationships (function calls, use statements, trait implementations)
- Support for Rust-specific constructs (impl blocks, associated functions, generics)
- Configurable behavior via ParserConfig
- Full integration with codegraph-parser-api
§Quick Start
use codegraph_rust::RustParser;
use codegraph_parser_api::CodeParser;
use codegraph::CodeGraph;
use std::path::Path;
let mut graph = CodeGraph::in_memory()?;
let parser = RustParser::new();
let file_info = parser.parse_file(Path::new("src/main.rs"), &mut graph)?;
println!("Parsed {} functions", file_info.functions.len());Structs§
- File
Info - Information about a successfully parsed file
- Parser
Config - Configuration for parser behavior
- Parser
Metrics - Metrics collected during parsing
- Project
Info - Aggregate information about a parsed project
- Rust
Parser - Rust language parser implementing the CodeParser trait
Enums§
- Parser
Error - Errors that can occur during parsing
Traits§
- Code
Parser - Core trait that all language parsers must implement