prelude.rs 990 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. // SPDX-License-Identifier: GPL-2.0
  2. //! The `kernel` prelude.
  3. //!
  4. //! These are the most common items used by Rust code in the kernel,
  5. //! intended to be imported by all Rust code, for convenience.
  6. //!
  7. //! # Examples
  8. //!
  9. //! ```
  10. //! use kernel::prelude::*;
  11. //! ```
  12. #[doc(no_inline)]
  13. pub use core::pin::Pin;
  14. pub use crate::alloc::{flags::*, Box, KBox, KVBox, KVVec, KVec, VBox, VVec, Vec};
  15. #[doc(no_inline)]
  16. pub use macros::{module, pin_data, pinned_drop, vtable, Zeroable};
  17. pub use super::build_assert;
  18. // `super::std_vendor` is hidden, which makes the macro inline for some reason.
  19. #[doc(no_inline)]
  20. pub use super::dbg;
  21. pub use super::{pr_alert, pr_crit, pr_debug, pr_emerg, pr_err, pr_info, pr_notice, pr_warn};
  22. pub use super::{init, pin_init, try_init, try_pin_init};
  23. pub use super::static_assert;
  24. pub use super::error::{code::*, Error, Result};
  25. pub use super::{str::CStr, ThisModule};
  26. pub use super::init::{InPlaceInit, InPlaceWrite, Init, PinInit};
  27. pub use super::current;