Crate kmod [] [src]

Bindings to libkmod to manage linux kernel modules.

Example

extern crate kmod;

fn main() {
    // create a new kmod context
    let ctx = kmod::Context::new().unwrap();

    // get a kmod_list of all loaded modules
    for module in ctx.modules_loaded().unwrap() {
        let name = module.name();
        let refcount = module.refcount();
        let size = module.size();

        let holders: Vec<_> = module.holders()
            .map(|x| x.name())
            .collect();

        println!("{:<19} {:8}  {} {:?}", name, size, refcount, holders);
    }
}

Structs

Context

The kmod context

Error

The Error type.

Module

Wrapper around a kmod_module

ModuleIterator

Iterator over a kmod_list of modules

Enums

ErrorKind

The kind of an error.

Type Definitions

Result

Convenient wrapper around std::Result.