Crate codegraph_rust

Crate codegraph_rust 

Source
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§

FileInfo
Information about a successfully parsed file
ParserConfig
Configuration for parser behavior
ParserMetrics
Metrics collected during parsing
ProjectInfo
Aggregate information about a parsed project
RustParser
Rust language parser implementing the CodeParser trait

Enums§

ParserError
Errors that can occur during parsing

Traits§

CodeParser
Core trait that all language parsers must implement