Skip to main content

Module

Trait Module 

Source
pub trait Module {
    // Provided methods
    fn early_init() -> Result<(), &'static str> { ... }
    fn late_init() -> Result<(), &'static str> { ... }
}
Available on crate feature full only.
Expand description

The top level trait for a kernel module.

This is to be implemented on a ZST to allow the module to hook into various points during kernel boot.

§Examples

See the module-level documentation.

Provided Methods§

Source

fn early_init() -> Result<(), &'static str>

Called immediately upon kernel start.

At this point many kernel features are unusable, such as threading, async tasks, and memory allocation.

Source

fn late_init() -> Result<(), &'static str>

Called once the kernel is ready to start userspace applications.

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.

Implementors§