1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// Marker Types Module
//
// Provides zero-cost marker types for compile-time type tracking.
// These types have no runtime representation but enable powerful
// type-level programming patterns.
use PhantomData as StdPhantomData;
/// Zero-sized type used to mark things that "act like" they own a T.
///
/// PhantomData<T> is used to tell the compiler that a type uses T,
/// even though T never appears in the struct's fields.
///
/// Common use cases:
/// - Generic wrapper types that don't directly store T
/// - Type-safe handles/IDs that track what they point to
/// - Zero-cost type-level state machines
///
/// # Examples
///
/// ```
/// use windjammer_runtime::marker::PhantomData;
///
/// // Type-safe buffer handle
/// pub struct BufferId<T> {
/// id: u32,
/// _phantom: PhantomData<T>,
/// }
///
/// // Compiler knows this BufferId is for CameraUniforms
/// let camera_buffer: BufferId<CameraUniforms> = BufferId {
/// id: 42,
/// _phantom: PhantomData,
/// };
/// ```
;
// Re-export for convenient use
pub use PhantomData as Phantom;