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;
31pub mod soft_ref;
32
33pub use api::{api, init_api};
35pub use error::{check_ffi, check_ffi_ctx, ffi_infallible, ffi_infallible_ctx, RustealError, RustealResult};
36pub use traits::{UeClass, UeStruct, UeEnum, UeHandle, ValidHandle, HasParent, Inherits};
37pub use object_ref::{Checked, ObjectPointer, UObjectRef};
38pub use subclass_of::SubclassOf;
39pub use soft_ref::SoftObjectRef;
40pub use struct_ref::UStructRef;
41pub use pinned::Pinned;
42pub use dynamic_call::{DynamicCall, DynamicCallResult};
43pub use logging::{LOG_DISPLAY, LOG_WARNING, LOG_ERROR};
44pub use ffi_guard::ffi_boundary;
45pub use containers::{ContainerElement, OwnedStruct, UeArray, UeMap, UeSet};
46pub use delegate_registry::DelegateBinding;
47
48pub use fname::FName;
50pub use struct_ref::{OutRef, out_ref_from_param, struct_ref_from_param};
51pub use weak_ptr::TWeakObjectPtr;
52pub use ue_math::{
53 Rotator, Transform, LinearColor, Color,
54 Plane, Ray, Sphere, UeBox, UeBox2d, BoxSphereBounds,
55};
56
57pub use rusteal_ffi::{
59 UObjectHandle, UClassHandle, FPropertyHandle, UStructHandle,
60 FNameHandle, FWeakObjectHandle, RustealErrorCode,
61};
62
63use std::sync::{Mutex, MutexGuard, RwLock, RwLockReadGuard, RwLockWriteGuard};
68
69pub(crate) fn lock_or_recover<T>(m: &Mutex<T>) -> MutexGuard<'_, T> {
71 m.lock().unwrap_or_else(|e| e.into_inner())
72}
73
74pub(crate) fn read_or_recover<T>(m: &RwLock<T>) -> RwLockReadGuard<'_, T> {
76 m.read().unwrap_or_else(|e| e.into_inner())
77}
78
79pub(crate) fn write_or_recover<T>(m: &RwLock<T>) -> RwLockWriteGuard<'_, T> {
81 m.write().unwrap_or_else(|e| e.into_inner())
82}