1pub mod api;
6pub mod error;
7pub mod traits;
8
9#[allow(unused_imports, unused_unsafe, unsafe_op_in_unsafe_fn, clippy::all)]
12pub mod ffi_dispatch {
13 include!(concat!(env!("OUT_DIR"), "/ffi_dispatch.rs"));
14}
15pub mod object_ref;
16pub mod subclass_of;
17pub mod struct_ref;
18pub mod pinned;
19pub mod dynamic_call;
20pub mod logging;
21pub mod ffi_guard;
22pub mod containers;
23pub mod delegate_registry;
24pub mod reify_registry;
25pub mod ue_math;
26pub mod fname;
27pub mod weak_ptr;
28pub mod widget;
29pub mod input;
30pub mod world;
31
32pub use api::{api, init_api};
34pub use error::{check_ffi, check_ffi_ctx, ffi_infallible, ffi_infallible_ctx, RustealError, RustealResult};
35pub use traits::{UeClass, UeStruct, UeEnum, UeHandle, ValidHandle, HasParent};
36pub use object_ref::{Checked, ObjectPointer, UObjectRef};
37pub use subclass_of::SubclassOf;
38pub use struct_ref::UStructRef;
39pub use pinned::Pinned;
40pub use dynamic_call::{DynamicCall, DynamicCallResult};
41pub use logging::{LOG_DISPLAY, LOG_WARNING, LOG_ERROR};
42pub use ffi_guard::ffi_boundary;
43pub use containers::{ContainerElement, OwnedStruct, UeArray, UeMap, UeSet};
44pub use delegate_registry::DelegateBinding;
45
46pub use fname::FName;
48pub use struct_ref::struct_ref_from_param;
49pub use weak_ptr::TWeakObjectPtr;
50pub use ue_math::{
51 Rotator, Transform, LinearColor, Color,
52 Plane, Ray, Sphere, UeBox, UeBox2d, BoxSphereBounds,
53};
54
55pub use rusteal_ffi::{
57 UObjectHandle, UClassHandle, FPropertyHandle, UStructHandle,
58 FNameHandle, FWeakObjectHandle, RustealErrorCode,
59};
60
61use std::sync::{Mutex, MutexGuard, RwLock, RwLockReadGuard, RwLockWriteGuard};
66
67pub(crate) fn lock_or_recover<T>(m: &Mutex<T>) -> MutexGuard<'_, T> {
69 m.lock().unwrap_or_else(|e| e.into_inner())
70}
71
72pub(crate) fn read_or_recover<T>(m: &RwLock<T>) -> RwLockReadGuard<'_, T> {
74 m.read().unwrap_or_else(|e| e.into_inner())
75}
76
77pub(crate) fn write_or_recover<T>(m: &RwLock<T>) -> RwLockWriteGuard<'_, T> {
79 m.write().unwrap_or_else(|e| e.into_inner())
80}