1use std::collections::BTreeMap;
2
3use serde::{Deserialize, Serialize};
4
5use crate::conventions::{Convention, Manual};
6use crate::graph::{ContractView, Node};
7use crate::search::SearchHit;
8
9#[derive(Debug, Clone, Serialize, Deserialize)]
10pub struct Search {
11 pub hits: Vec<SearchHit>,
12 pub markdown: String,
13}
14
15#[derive(Debug, Clone, Serialize, Deserialize)]
16pub struct Why {
17 pub name: String,
18 pub markdown: String,
19}
20
21#[derive(Debug, Clone, Default, Serialize, Deserialize)]
22pub struct Ledger {
23 pub markdown: String,
24 pub note: Option<String>,
26 pub failed: bool,
28}
29
30#[derive(Debug, Clone, Serialize, Deserialize)]
31pub struct Flow {
32 pub focus: String,
33 pub narration: Option<(String, Vec<String>)>,
35 pub steps: Vec<Step>,
36}
37
38#[derive(Debug, Clone, Serialize, Deserialize)]
39pub struct Step {
40 pub depth: usize,
41 pub via: String,
42 pub name: String,
43 pub location: String,
44}
45
46#[derive(Debug, Clone, Serialize, Deserialize)]
47pub struct Contracts {
48 pub total: usize,
50 pub views: Vec<ContractView>,
51}
52
53#[derive(Debug, Clone, Serialize, Deserialize)]
54pub struct Conventions {
55 pub conventions: Vec<Convention>,
56 pub hidden: Vec<Manual>,
57}
58
59#[derive(Debug, Clone, Serialize, Deserialize)]
60pub struct Explore {
61 pub symbols: usize,
62 pub edges: usize,
63 pub dangling: usize,
64 pub view: Option<ExploreView>,
66}
67
68#[derive(Debug, Clone, Serialize, Deserialize)]
69pub struct ExploreView {
70 pub focus: Option<Node>,
71 pub container: Option<Node>,
72 pub callees: Vec<Node>,
73 pub callers: Vec<Node>,
74 pub importers: Vec<Node>,
75 pub members: Vec<Node>,
76 pub dependents: usize,
78 pub by_repo: BTreeMap<String, usize>,
79 pub budget: usize,
80 pub pack: Vec<(Node, usize)>,
82}
83
84#[derive(Debug, Clone, Serialize, Deserialize)]
85pub struct Stats {
86 pub symbols: usize,
87 pub indexed: usize,
89 pub unknown: Vec<String>,
91 pub repos: Vec<RepoStats>,
92}
93
94#[derive(Debug, Clone, Serialize, Deserialize)]
95pub struct RepoStats {
96 pub repo: String,
97 pub symbols: usize,
98 pub edges: usize,
99 pub enriched: usize,
100 pub kinds: BTreeMap<String, usize>,
101}
102
103#[derive(Debug, Clone, Serialize, Deserialize)]
104pub struct Preflight {
105 pub markdown: String,
106 pub blocking: bool,
108}
109
110pub const RIPPLE_DEPTH: usize = 4;
112
113#[derive(Debug, Clone, Default, Serialize, Deserialize)]
115pub struct Hook {
116 pub text: String,
117 pub ids: Vec<String>,
119}