pub struct ModUnloader { /* private fields */ }Expand description
Module unloader.
Asynchronous methods can be enabled via the optional async feature.
Implementations§
Source§impl ModUnloader
impl ModUnloader
Sourcepub fn forced(self, force_unload: bool) -> Self
pub fn forced(self, force_unload: bool) -> Self
Set whether a forced unload should be performed.
A force unload will taint the kernel and can leave the host in an unstable state, or cause data loss.
Sourcepub fn unload_sync<S: AsRef<str>>(
&self,
modname: S,
blocking: bool,
) -> Result<()>
pub fn unload_sync<S: AsRef<str>>( &self, modname: S, blocking: bool, ) -> Result<()>
Unload module by name, synchronously.
If blocking is enabled, this can block at syscall level (putting
the process in D state) while waiting for module reference count
to be 0 for clean unloading (unless forced).
It is usually recommended not to set blocking, as the process
cannot be killed while blocked on syscall. Consider using
unload_async instead.
Sourcepub fn unload_async<S: AsRef<str>>(
&self,
modname: S,
pause_millis: NonZeroU64,
) -> Box<dyn Future<Item = (), Error = Error>>
pub fn unload_async<S: AsRef<str>>( &self, modname: S, pause_millis: NonZeroU64, ) -> Box<dyn Future<Item = (), Error = Error>>
Unload module by name, asynchronously.
If the module is currently in use, this will continuously retry
unloading at fixed intervals after pausing for the specified
amount of milliseconds.
This requires enabling the async optional feature.
Trait Implementations§
Source§impl Clone for ModUnloader
impl Clone for ModUnloader
Source§fn clone(&self) -> ModUnloader
fn clone(&self) -> ModUnloader
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more