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.
§Examples
use kernel::prelude::*;Re-exports§
- pub use core::pin::Pin;
- pub use crate::alloc::Box;
- pub use crate::alloc::KBox;
- pub use crate::alloc::KVBox;
- pub use crate::alloc::KVVec;
- pub use crate::alloc::KVec;
- pub use crate::alloc::VBox;
- pub use crate::alloc::VVec;
- pub use crate::alloc::Vec;
- pub use macros::module;
- pub use macros::pin_data;
- pub use macros::pinned_drop;
- pub use macros::vtable;
- pub use macros::Zeroable;
- pub use super::dbg;
- pub use super::init;
- pub use super::init;
- pub use super::error::Error;
- pub use super::error::Result;
- pub use super::str::CStr;
- pub use super::ThisModule;
- pub use super::init::InPlaceInit;
- pub use super::init::InPlaceWrite;
- pub use super::init::Init;
- pub use super::init::PinInit;
- pub use crate::alloc::flags::*;
- pub use super::error::code::*;
Macros§
- Asserts that a boolean expression istrueat compile time.
- Returns the currently running task.
- Prints an alert-level message (level 1) prefixed with device information.
- Prints a critical-level message (level 2) prefixed with device information.
- Prints a debug-level message (level 7) prefixed with device information.
- Prints an emergency-level message (level 0) prefixed with device information.
- Prints an error-level message (level 3) prefixed with device information.
- Prints an info-level message (level 6) prefixed with device information.
- Prints a notice-level message (level 5) prefixed with device information.
- Prints a warning-level message (level 4) prefixed with device information.
- A convenience alias forcore::format_args.
- Construct an in-place initializer forstructs.
- Construct an in-place, pinned initializer forstructs.
- Prints an alert-level message (level 1).
- Prints a critical-level message (level 2).
- Prints a debug-level message (level 7).
- Prints an emergency-level message (level 0).
- Prints an error-level message (level 3).
- Prints an info-level message (level 6).
- Prints a notice-level message (level 5).
- Prints a warning-level message (level 4).
- Static assert (i.e. compile-time assert).
- Construct an in-place fallible initializer forstructs.
- Construct an in-place, fallible pinned initializer forstructs.