xref: /kernel/linux/linux-6.6/rust/kernel/prelude.rs (revision 62306a36)
162306a36Sopenharmony_ci// SPDX-License-Identifier: GPL-2.0
262306a36Sopenharmony_ci
362306a36Sopenharmony_ci//! The `kernel` prelude.
462306a36Sopenharmony_ci//!
562306a36Sopenharmony_ci//! These are the most common items used by Rust code in the kernel,
662306a36Sopenharmony_ci//! intended to be imported by all Rust code, for convenience.
762306a36Sopenharmony_ci//!
862306a36Sopenharmony_ci//! # Examples
962306a36Sopenharmony_ci//!
1062306a36Sopenharmony_ci//! ```
1162306a36Sopenharmony_ci//! use kernel::prelude::*;
1262306a36Sopenharmony_ci//! ```
1362306a36Sopenharmony_ci
1462306a36Sopenharmony_ci#[doc(no_inline)]
1562306a36Sopenharmony_cipub use core::pin::Pin;
1662306a36Sopenharmony_ci
1762306a36Sopenharmony_ci#[doc(no_inline)]
1862306a36Sopenharmony_cipub use alloc::{boxed::Box, vec::Vec};
1962306a36Sopenharmony_ci
2062306a36Sopenharmony_ci#[doc(no_inline)]
2162306a36Sopenharmony_cipub use macros::{module, pin_data, pinned_drop, vtable, Zeroable};
2262306a36Sopenharmony_ci
2362306a36Sopenharmony_cipub use super::build_assert;
2462306a36Sopenharmony_ci
2562306a36Sopenharmony_ci// `super::std_vendor` is hidden, which makes the macro inline for some reason.
2662306a36Sopenharmony_ci#[doc(no_inline)]
2762306a36Sopenharmony_cipub use super::dbg;
2862306a36Sopenharmony_cipub use super::{pr_alert, pr_crit, pr_debug, pr_emerg, pr_err, pr_info, pr_notice, pr_warn};
2962306a36Sopenharmony_ci
3062306a36Sopenharmony_cipub use super::{init, pin_init, try_init, try_pin_init};
3162306a36Sopenharmony_ci
3262306a36Sopenharmony_cipub use super::static_assert;
3362306a36Sopenharmony_ci
3462306a36Sopenharmony_cipub use super::error::{code::*, Error, Result};
3562306a36Sopenharmony_ci
3662306a36Sopenharmony_cipub use super::{str::CStr, ThisModule};
3762306a36Sopenharmony_ci
3862306a36Sopenharmony_cipub use super::init::{InPlaceInit, Init, PinInit};
3962306a36Sopenharmony_ci
4062306a36Sopenharmony_cipub use super::current;
41