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::export;
pub use macros::module;
pub use macros::vtable;
pub use super::build_assert;
pub use super::build_assert;
pub use super::dbg;
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 crate::alloc::flags::*;
pub use super::error::code::*;
Macros§
- build_
assert - Asserts that a boolean expression is
true
at compile time. - build_
error - Fails the build if the code path calling
build_error!
can possibly be executed. - current
- Returns the currently running task.
- dev_
alert - Prints an alert-level message (level 1) prefixed with device information.
- dev_
crit - Prints a critical-level message (level 2) prefixed with device information.
- dev_dbg
- Prints a debug-level message (level 7) prefixed with device information.
- dev_
emerg - Prints an emergency-level message (level 0) prefixed with device information.
- dev_err
- Prints an error-level message (level 3) prefixed with device information.
- dev_
info - Prints an info-level message (level 6) prefixed with device information.
- dev_
notice - Prints a notice-level message (level 5) prefixed with device information.
- dev_
warn - Prints a warning-level message (level 4) prefixed with device information.
- fmt
- A convenience alias for
core::format_args
. - init
- Construct an in-place initializer for
struct
s. - pin_
init - Construct an in-place, pinned initializer for
struct
s. - pr_
alert - Prints an alert-level message (level 1).
- pr_crit
- Prints a critical-level message (level 2).
- pr_
debug - Prints a debug-level message (level 7).
- pr_
emerg - Prints an emergency-level message (level 0).
- pr_err
- Prints an error-level message (level 3).
- pr_info
- Prints an info-level message (level 6).
- pr_
notice - Prints a notice-level message (level 5).
- pr_warn
- Prints a warning-level message (level 4).
- static_
assert - Static assert (i.e. compile-time assert).
- try_
init - Construct an in-place fallible initializer for
struct
s. - try_
pin_ init - Construct an in-place, fallible pinned initializer for
struct
s.
Traits§
- InPlace
Write - Smart pointer containing uninitialized memory and that can write a value.
- Init
- An initializer for
T
. - PinInit
- A pin-initializer for the type
T
. - Zeroable
- Marker trait for types that can be initialized by writing just zeroes.