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 struct_ref;
17pub mod pinned;
18pub mod dynamic_call;
19pub mod logging;
20pub mod ffi_guard;
21pub mod containers;
22pub mod delegate_registry;
23pub mod reify_registry;
24pub mod ue_math;
25pub mod fname;
26pub mod weak_ptr;
27pub mod widget;
28pub mod world;
29
30pub use api::{api, init_api};
32pub use error::{check_ffi, check_ffi_ctx, ffi_infallible, ffi_infallible_ctx, RustealError, RustealResult};
33pub use traits::{UeClass, UeStruct, UeEnum, UeHandle, ValidHandle, HasParent};
34pub use object_ref::{Checked, UObjectRef};
35pub use struct_ref::UStructRef;
36pub use pinned::Pinned;
37pub use dynamic_call::{DynamicCall, DynamicCallResult};
38pub use logging::{LOG_DISPLAY, LOG_WARNING, LOG_ERROR};
39pub use ffi_guard::ffi_boundary;
40pub use containers::{ContainerElement, OwnedStruct, UeArray, UeMap, UeSet};
41pub use delegate_registry::DelegateBinding;
42
43pub use fname::FName;
45pub use struct_ref::struct_ref_from_param;
46pub use weak_ptr::TWeakObjectPtr;
47pub use ue_math::{
48 Rotator, Transform, LinearColor, Color,
49 Plane, Ray, Sphere, UeBox, UeBox2d, BoxSphereBounds,
50};
51
52pub use rusteal_ffi::{
54 UObjectHandle, UClassHandle, FPropertyHandle, UStructHandle,
55 FNameHandle, FWeakObjectHandle, RustealErrorCode,
56};
57
58use std::sync::{Mutex, MutexGuard, RwLock, RwLockReadGuard, RwLockWriteGuard};
63
64pub(crate) fn lock_or_recover<T>(m: &Mutex<T>) -> MutexGuard<'_, T> {
66 m.lock().unwrap_or_else(|e| e.into_inner())
67}
68
69pub(crate) fn read_or_recover<T>(m: &RwLock<T>) -> RwLockReadGuard<'_, T> {
71 m.read().unwrap_or_else(|e| e.into_inner())
72}
73
74pub(crate) fn write_or_recover<T>(m: &RwLock<T>) -> RwLockWriteGuard<'_, T> {
76 m.write().unwrap_or_else(|e| e.into_inner())
77}