pub trait Module:
Sized
+ Sync
+ Send {
// Required method
fn init(module: &'static ThisModule) -> Result<Self>;
}
Expand description
The top level entrypoint to implementing a kernel module.
For any teardown or cleanup operations, your type may implement Drop
.
Required Methods§
Sourcefn init(module: &'static ThisModule) -> Result<Self>
fn init(module: &'static ThisModule) -> Result<Self>
Called at module initialization time.
Use this method to perform whatever setup or registration your module should do.
Equivalent to the module_init
macro in the C API.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.