Struct kernel::ThisModule
source · [−]pub struct ThisModule(_);
Expand description
Equivalent to THIS_MODULE
in the C API.
C header: include/linux/export.h
Implementations
sourceimpl ThisModule
impl ThisModule
sourcepub const unsafe fn from_ptr(ptr: *mut module) -> ThisModule
pub const unsafe fn from_ptr(ptr: *mut module) -> ThisModule
Creates a ThisModule
given the THIS_MODULE
pointer.
Safety
The pointer must be equal to the right THIS_MODULE
.
sourcepub fn kernel_param_lock(&self) -> KParamGuard<'_>
pub fn kernel_param_lock(&self) -> KParamGuard<'_>
Locks the module parameters to access them.
Returns a KParamGuard
that will release the lock when dropped.
Trait Implementations
impl Sync for ThisModule
Auto Trait Implementations
impl RefUnwindSafe for ThisModule
impl !Send for ThisModule
impl Unpin for ThisModule
impl UnwindSafe for ThisModule
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more