1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
use ;
use PathBuf;
/// Implementation of ModuleUnit.
///
/// # Examples
///
/// ```
/// use codebank::{ModuleUnit, Visibility};
///
/// // Create a new public module
/// let module = ModuleUnit::new(
/// "example".to_string(),
/// Visibility::Public,
/// Some("Module documentation".to_string()),
/// );
///
/// assert_eq!(module.name, "example");
/// assert!(matches!(module.visibility, Visibility::Public));
/// assert_eq!(module.doc, Some("Module documentation".to_string()));
/// assert!(module.functions.is_empty());
/// assert!(module.structs.is_empty());
/// assert!(module.traits.is_empty());
/// assert!(module.impls.is_empty());
/// assert!(module.submodules.is_empty());
/// ```
/// Implementation of FileUnit.
///
/// # Examples
///
/// ```
/// use std::path::PathBuf;
/// use codebank::FileUnit;
///
/// // Create a new file unit
/// let file = FileUnit::new(PathBuf::from("src/lib.rs"));
///
/// assert_eq!(file.path, PathBuf::from("src/lib.rs"));
/// assert!(file.doc.is_none());
/// assert!(file.declares.is_empty());
/// assert!(file.modules.is_empty());
/// assert!(file.functions.is_empty());
/// assert!(file.structs.is_empty());
/// assert!(file.traits.is_empty());
/// assert!(file.impls.is_empty());
/// assert!(file.source.is_none());
/// ```