[−][src]Struct linapi::modules::LoadedModule
Describes a loaded Linux kernel Module
Methods
impl LoadedModule
[src]
pub fn from_name(name: &str) -> Self
[src]
pub fn get_loaded() -> Vec<Self>
[src]
Get currently loaded dynamic kernel modules
Note
Modules can be unloaded, and if that happens methods on LoadedModule
will panic
pub fn unload(self)
[src]
pub unsafe fn force_unload(self)
[src]
Forcefully unload a kernel module.
Safety
Force unloading is wildly dangerous and will taint your kernel.
It can cause modules to be unloaded while still in use, or unload modules not designed to be unloaded.
Panics
- On failure
pub fn name(&self) -> &str
[src]
Name of the module
pub fn module_type(&self) -> Type
[src]
Module type, Builtin or Dynamic
pub fn parameters(&self) -> HashMap<String, Vec<u8>>
[src]
Module parameters.
The kernel exposes these as files in a directory, and their contents are
entirely module specific, hence Vec<(String, Vec<u8>)>
, which can be
std::io::Read
.
Stability
The stability of parameters depends entirely on the specific module.
pub fn ref_count(&self) -> Option<u32>
[src]
Module reference count.
If the module is built-in, or if the kernel was not built with
CONFIG_MODULE_UNLOAD
, this will be None
pub fn size(&self) -> u64
[src]
Module size in bytes
pub fn taint(&self) -> Option<Taint>
[src]
pub fn holders(&self) -> Vec<Self>
[src]
List of other modules that use/reference this one.
Note
This uses the holders
sysfs folder, which is completely undocumented
by the kernel, beware.
pub fn file_path(&self) -> PathBuf
[src]
Path to the module file.
Note
There is no guarantee the returned path is the same module. The file may have changed on disk.
This is equivalent to find_module_file(&module.name())
pub fn status(&self) -> Status
[src]
Module status.
Note
This uses the undocumented initstate
file, which is probably
module_state
from linux/module.h
.
Trait Implementations
impl Debug for LoadedModule
[src]
impl UEvent for LoadedModule
[src]
Auto Trait Implementations
impl RefUnwindSafe for LoadedModule
impl Send for LoadedModule
impl Sync for LoadedModule
impl Unpin for LoadedModule
impl UnwindSafe for LoadedModule
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> UEvent for T where
T: Device,
[src]
T: Device,