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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
// Marker traits for UE reflection types. Codegen generates impls for all
// exported UClasses, UStructs, and UEnums.
use ;
use crateRustealResult;
/// Implemented by codegen for every exported UClass.
///
/// Provides the static UClass handle needed for cast checks and reflection
/// queries. The handle is typically cached in a `OnceLock` on first access.
/// Implemented by codegen for every exported UScriptStruct.
/// Implemented by codegen for every exported UEnum.
/// Declares the immediate UE parent class for codegen-exported classes.
///
/// Enables blanket `Deref` impls on `UObjectRef<T>`, `Checked<T>`, and
/// `Pinned<T>` so inherited methods resolve automatically through the
/// Deref chain instead of being flattened into each child's Ext trait.
///
/// Codegen generates `impl HasParent for Pawn { type Parent = Actor; }` etc.
/// Root classes (e.g., `UObject`) do NOT implement this trait.
/// `Self` is `U` or one of its subclasses: a `UObjectRef<Self>` is a valid
/// `UObjectRef<U>`, as a `Character*` is an `AActor*` in C++.
///
/// Codegen implements it for every class and each of its ancestors
/// (`impl Inherits<Actor> for Character`); a Rust `#[uclass]` gets it for
/// everything its parent inherits. See `UObjectRef::upcast_to`.
/// Trait for types that hold a UObject handle and can validate it.
///
/// Both `UObjectRef<T>` and `Pinned<T>` implement this, enabling fallible
/// validity checks. For infallible access, use [`ValidHandle`] instead.
/// Trait for types that have been pre-validated and can provide a handle
/// without fallibility. `Checked<T>` and `Pinned<T>` implement this.
///
/// Codegen extension traits use this as a supertrait so that methods
/// return `T` directly instead of `RustealResult<T>`.