rust/kernel/prelude.rs
Source file repositories/reference/linux-study-clean/rust/kernel/prelude.rs
File Facts
- System
- Linux kernel
- Corpus path
rust/kernel/prelude.rs- Extension
.rs- Size
- 1847 bytes
- Lines
- 121
- Domain
- Rust Kernel Layer
- Bucket
- Rust API Membrane
- Inferred role
- Rust Kernel Layer: implementation source
- Status
- source implementation candidate
Why This File Exists
Rust-side wrappers and abstractions around kernel C APIs, ownership contracts, allocation, synchronization, and module integration.
- Rust-side wrappers and abstractions around kernel C APIs, ownership contracts, allocation, synchronization, and module integration.
Dependency Surface
- No C-style include directives detected by the generator.
Detected Declarations
- No top-level syscall, struct, function, initcall, or export declaration detected by the generator.
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0
//! 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::*;
//! ```
#[doc(no_inline)]
pub use core::{
mem::{
align_of,
align_of_val,
size_of,
size_of_val, //
},
pin::Pin, //
};
#[doc(no_inline)]
pub use ::ffi::{
c_char,
c_int,
c_long,
c_longlong,
c_schar,
c_short,
c_uchar,
c_uint,
c_ulong,
c_ulonglong,
c_ushort,
c_void,
CStr, //
};
#[doc(no_inline)]
pub use macros::{
export,
fmt,
kunit_tests,
module,
vtable, //
};
#[doc(no_inline)]
pub use pin_init::{
init,
pin_data,
pin_init,
pinned_drop,
InPlaceWrite,
Init,
PinInit,
Zeroable, //
};
#[doc(no_inline)]
pub use zerocopy::FromBytes;
#[doc(no_inline)]
pub use zerocopy_derive::FromBytes;
#[doc(no_inline)]
pub use super::{
alloc::{
flags::*,
Box,
KBox,
KVBox,
KVVec,
KVec,
VBox,
VVec,
Vec, //
},
build_assert::{
build_assert,
build_error,
const_assert,
static_assert, //
},
current,
dev_alert,
dev_crit,
Annotation
- Atlas domain: Rust Kernel Layer / Rust API Membrane.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.