pub struct ModuleParamAccess<T> { /* private fields */ }Expand description
A wrapper for kernel parameters.
This type is instantiated by the module! macro when module parameters are
defined. You should never need to instantiate this type directly.
Note: This type is pub because it is used by module crates to access
parameter values.
Implementations§
Source§impl<T> ModuleParamAccess<T>
impl<T> ModuleParamAccess<T>
Sourcepub fn value(&self) -> Twhere
T: Copy,
pub fn value(&self) -> Twhere
T: Copy,
Get a copy of the parameter value.
Returns the value supplied at module load time, or the default value if the parameter has not been set.
Sourcepub fn value_ref(&self) -> &T
pub fn value_ref(&self) -> &T
Get a shared reference to the parameter value.
Returns a reference to the value supplied at module load time, or a reference to the default value if the parameter has not been set.
Sourcepub const fn as_void_ptr(&self) -> *mut c_void
pub const fn as_void_ptr(&self) -> *mut c_void
Get a mutable pointer to self.
NOTE: In most cases it is not safe deref the returned pointer.
Trait Implementations§
impl<T: Sync> Sync for ModuleParamAccess<T>
Auto Trait Implementations§
impl<T> !Freeze for ModuleParamAccess<T>
impl<T> !RefUnwindSafe for ModuleParamAccess<T>
impl<T> Send for ModuleParamAccess<T>where
T: Send,
impl<T> Unpin for ModuleParamAccess<T>where
T: Unpin,
impl<T> UnsafeUnpin for ModuleParamAccess<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for ModuleParamAccess<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> KnownSize for T
impl<T> KnownSize for T
Source§impl<T> PinInit<T> for T
impl<T> PinInit<T> for T
Source§unsafe fn __pinned_init(self, slot: *mut T) -> Result<(), Infallible>
unsafe fn __pinned_init(self, slot: *mut T) -> Result<(), Infallible>
Initializes
slot. Read more