We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent beaf62a commit c278d89Copy full SHA for c278d89
1 file changed
examples/current.rs
@@ -1,12 +1,24 @@
1
use rkmod::cache::InternCache;
2
+use rkmod::controller::SystemModuleController;
3
use rkmod::directory::ModuleDirectory;
4
5
fn main() {
6
let directory =
7
ModuleDirectory::current(InternCache::default()).expect("could not load module directory");
8
+ let controller = SystemModuleController::default();
9
+ let mut loaded: usize = 0;
10
+ for module in directory.database().modules().values() {
11
+ let is_live = controller.is_live(module.name().as_str()).unwrap_or(false);
12
+
13
+ if is_live {
14
+ loaded += 1;
15
+ }
16
17
18
println!(
- "{} has {} modules",
19
+ "{} has {} modules ({} loaded)",
20
directory.root().to_string_lossy(),
- directory.database().modules().len()
21
+ directory.database().modules().len(),
22
+ loaded,
23
);
24
}
0 commit comments