xref: /linux/rust/kernel/prelude.rs (revision 0e685c3e7158d35626d6d76b9f859eae806d87fa)
1 // SPDX-License-Identifier: GPL-2.0
2 
3 //! The `kernel` prelude.
4 //!
5 //! These are the most common items used by Rust code in the kernel,
6 //! intended to be imported by all Rust code, for convenience.
7 //!
8 //! # Examples
9 //!
10 //! ```
11 //! use kernel::prelude::*;
12 //! ```
13 
14 #[doc(no_inline)]
15 pub use core::pin::Pin;
16 
17 #[doc(no_inline)]
18 pub use alloc::{boxed::Box, vec::Vec};
19 
20 #[doc(no_inline)]
21 pub use macros::{module, vtable};
22 
23 pub use super::build_assert;
24 
25 // `super::std_vendor` is hidden, which makes the macro inline for some reason.
26 #[doc(no_inline)]
27 pub use super::dbg;
28 pub use super::{pr_alert, pr_crit, pr_debug, pr_emerg, pr_err, pr_info, pr_notice, pr_warn};
29 
30 pub use super::static_assert;
31 
32 pub use super::error::{code::*, Error, Result};
33 
34 pub use super::{str::CStr, ThisModule};
35