xref: /linux/rust/kernel/prelude.rs (revision 3daee2e4b3568f0ed88b0598df96547fcf21cb9b)
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 pub use crate::alloc::{box_ext::BoxExt, flags::*, vec_ext::VecExt};
18 
19 #[doc(no_inline)]
20 pub use alloc::{boxed::Box, vec::Vec};
21 
22 #[doc(no_inline)]
23 pub use macros::{module, pin_data, pinned_drop, vtable, Zeroable};
24 
25 pub use super::build_assert;
26 
27 // `super::std_vendor` is hidden, which makes the macro inline for some reason.
28 #[doc(no_inline)]
29 pub use super::dbg;
30 pub use super::{pr_alert, pr_crit, pr_debug, pr_emerg, pr_err, pr_info, pr_notice, pr_warn};
31 
32 pub use super::{init, pin_init, try_init, try_pin_init};
33 
34 pub use super::static_assert;
35 
36 pub use super::error::{code::*, Error, Result};
37 
38 pub use super::{str::CStr, ThisModule};
39 
40 pub use super::init::{InPlaceInit, Init, PinInit};
41 
42 pub use super::current;
43