Expand description

The kernel prelude.

These are the most common items used by Rust code in the kernel, intended to be imported by all Rust code, for convenience.


use kernel::prelude::*;


pub use super::build_assert;
pub use super::dev_alert;
pub use super::dev_crit;
pub use super::dev_dbg;
pub use super::dev_emerg;
pub use super::dev_err;
pub use super::dev_info;
pub use super::dev_notice;
pub use super::dev_warn;
pub use super::fmt;
pub use super::pr_alert;
pub use super::pr_crit;
pub use super::pr_debug;
pub use super::pr_emerg;
pub use super::pr_err;
pub use super::pr_info;
pub use super::pr_notice;
pub use super::pr_warn;
pub use super::module_fs;
pub use super::module_misc_device;
pub use super::static_assert;
pub use super::error::code::*;
pub use super::Error;
pub use super::Result;
pub use super::str::CStr;
pub use super::ThisModule;


std::dbg, but using pr_info instead of eprintln.

Declares a kernel module.


An owned reference to an always-reference-counted object.

A pointer type for heap allocation.

A pinned pointer.

A UTF-8–encoded, growable string.

A contiguous growable array type, written as Vec<T>, short for ‘vector’.

Attribute Macros

Declares or implements a vtable trait.