Skip to main content

reposcry_graph/
symbol.rs

1use serde::{Deserialize, Serialize};
2
3#[derive(Debug, Clone, Serialize, Deserialize)]
4pub struct Symbol {
5    pub id: Option<i64>,
6    pub file_path: String,
7    pub name: String,
8    pub kind: String,
9    pub start_line: u32,
10    pub end_line: u32,
11    pub signature: Option<String>,
12    pub visibility: Option<String>,
13    pub doc_comment: Option<String>,
14}
15
16#[derive(Debug, Clone, Serialize, Deserialize)]
17pub struct Import {
18    pub source: String,
19    pub target: String,
20    pub is_relative: bool,
21    pub imported_names: Vec<String>,
22    pub line: u32,
23}
24
25#[derive(Debug, Clone, Serialize, Deserialize)]
26pub struct CallSite {
27    pub caller: String,
28    pub callee: String,
29    pub file: String,
30    pub line: u32,
31    pub confidence: f64,
32    pub resolution_strategy: Option<String>,
33}
34
35#[derive(Debug, Clone, Serialize, Deserialize)]
36pub struct TestCase {
37    pub name: String,
38    pub file: String,
39    pub line: u32,
40    pub is_async: bool,
41}
42
43#[derive(Debug, Clone, Serialize, Deserialize)]
44pub struct ParsedFile {
45    pub path: String,
46    pub language: String,
47    pub symbols: Vec<Symbol>,
48    pub imports: Vec<Import>,
49    pub calls: Vec<CallSite>,
50    pub tests: Vec<TestCase>,
51    pub hash: String,
52    pub size_bytes: u64,
53    pub loc: u32,
54}