pub struct UObjectRef<T: UeClass> { /* private fields */ }Expand description
Implementations§
Source§impl<T: UeClass> UObjectRef<T>
impl<T: UeClass> UObjectRef<T>
Sourcepub unsafe fn from_raw(handle: UObjectHandle) -> Self
pub unsafe fn from_raw(handle: UObjectHandle) -> Self
Create from a raw FFI handle.
§Safety
The caller must ensure the handle points to an object whose UClass
is T or a subclass of T.
Sourcepub fn raw(&self) -> UObjectHandle
pub fn raw(&self) -> UObjectHandle
Get the underlying raw handle.
Sourcepub fn checked(&self) -> UikaResult<Checked<T>>
pub fn checked(&self) -> UikaResult<Checked<T>>
Validate that the object is still alive, returning a Checked<T>
handle that provides infallible access to extension trait methods.
Sourcepub fn cast<U: UeClass>(self) -> UikaResult<UObjectRef<U>>
pub fn cast<U: UeClass>(self) -> UikaResult<UObjectRef<U>>
Cast to a different UClass type. Fails if the object is destroyed
or is not an instance of U.
Sourcepub fn pin(self) -> UikaResult<Pinned<T>>
pub fn pin(self) -> UikaResult<Pinned<T>>
Upgrade to a Pinned<T>, adding a GC root to keep the object alive.
Sourcepub fn get_name(&self) -> UikaResult<String>
pub fn get_name(&self) -> UikaResult<String>
Get the object’s FName as a String.
Sourcepub fn get_class(&self) -> UikaResult<UClassHandle>
pub fn get_class(&self) -> UikaResult<UClassHandle>
Get the object’s UClass handle.
Sourcepub fn get_outer(&self) -> UikaResult<UObjectHandle>
pub fn get_outer(&self) -> UikaResult<UObjectHandle>
Get the object’s Outer.
Trait Implementations§
Source§impl<T: Clone + UeClass> Clone for UObjectRef<T>
impl<T: Clone + UeClass> Clone for UObjectRef<T>
Source§fn clone(&self) -> UObjectRef<T>
fn clone(&self) -> UObjectRef<T>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<T: UeClass> ContainerElement for UObjectRef<T>
impl<T: UeClass> ContainerElement for UObjectRef<T>
Source§const BUF_SIZE: u32
const BUF_SIZE: u32
Buffer size for FFI transport. Must be large enough for the C++ side
to write the element value.
Source§unsafe fn read_from_buf(buf: *const u8, _written: u32) -> Self
unsafe fn read_from_buf(buf: *const u8, _written: u32) -> Self
Interpret bytes from the C++ side into a Rust value. Read more
Source§unsafe fn write_to_buf(&self, buf: *mut u8) -> u32
unsafe fn write_to_buf(&self, buf: *mut u8) -> u32
Write this value into a buffer for C++
WriteElement to consume.
Returns the number of bytes written. Read moreSource§const RAW_COPYABLE: bool = false
const RAW_COPYABLE: bool = false
Whether this type can be bulk-copied as raw bytes (no per-element framing).
True for fixed-size primitives (bool, integers, floats) and FName.
Source§impl<T: UeClass> Debug for UObjectRef<T>
impl<T: UeClass> Debug for UObjectRef<T>
Source§impl<T: UeClass> UeHandle for UObjectRef<T>
impl<T: UeClass> UeHandle for UObjectRef<T>
Source§fn checked_handle(&self) -> UikaResult<UObjectHandle>
fn checked_handle(&self) -> UikaResult<UObjectHandle>
Return the raw handle if the object is alive, or
Err(ObjectDestroyed).Source§fn raw_handle(&self) -> UObjectHandle
fn raw_handle(&self) -> UObjectHandle
Return the raw handle without validity check.
impl<T: Copy + UeClass> Copy for UObjectRef<T>
impl<T: Eq + UeClass> Eq for UObjectRef<T>
impl<T: UeClass> Send for UObjectRef<T>
impl<T: UeClass> StructuralPartialEq for UObjectRef<T>
Auto Trait Implementations§
impl<T> Freeze for UObjectRef<T>
impl<T> RefUnwindSafe for UObjectRef<T>where
T: RefUnwindSafe,
impl<T> !Sync for UObjectRef<T>
impl<T> Unpin for UObjectRef<T>
impl<T> UnsafeUnpin for UObjectRef<T>
impl<T> UnwindSafe for UObjectRef<T>where
T: RefUnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more