[][src]Struct linapi::modules::ModuleFile

pub struct ModuleFile { /* fields omitted */ }

A Linux Kernel Module file on disk.

Methods

impl ModuleFile[src]

pub fn from_name(name: &str) -> Self[src]

Search /lib/modules/(uname -r) for the module name.

Panics

  • If the module couldn't be found

pub fn from_path(path: &Path) -> Self[src]

Use the file at path as a module.

Panics

  • If the module couldn't be found

pub fn load(&self, param: &str) -> LoadedModule[src]

Load this kernel module, and return the LoadedModule describing it.

Arguments

  • parameters for the kernel module. See module documentation for details, and init_module(2) for details on formatting.

Panics

  • On failure

Note

Kernel modules may be compressed, and depending on crate features this function may automatically decompress it.

pub unsafe fn force_load(&self, param: &str) -> LoadedModule[src]

Force load this kernel module, and return the LoadedModule describing it.

Arguments

  • parameters for the kernel module. See module documentation for details, and init_module(2) for details on formatting.

Safety

Force loading a kernel module is dangerous, it skips important safety checks that help ensure module compatibility with your kernel.

Note

Kernel modules may be compressed, and depending on crate features this function may automatically decompress it.

pub fn path(&self) -> &Path[src]

pub fn name(&self) -> &str[src]

pub fn info(&self) -> ModInfo[src]

Get information embedded in the module file.

Note

This uses the .modinfo ELF section, which seems to be entirely undocumented.

Kernel modules also may be compressed, and depending on crate features, this function may automatically decompress it.

pub fn has_signature(&self) -> bool[src]

Whether the module has a signature.

This does not check if it's valid.

Note

This is a temporary API.

Trait Implementations

impl Debug for ModuleFile[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.