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) -> RustealResult<Checked<T>>
pub fn checked(&self) -> RustealResult<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) -> RustealResult<UObjectRef<U>>
pub fn cast<U: UeClass>(self) -> RustealResult<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) -> RustealResult<Pinned<T>>
pub fn pin(self) -> RustealResult<Pinned<T>>
Upgrade to a Pinned<T>, adding a GC root to keep the object alive.
Sourcepub fn get_name(&self) -> RustealResult<String>
pub fn get_name(&self) -> RustealResult<String>
Get the object’s FName as a String.
Sourcepub fn get_class(&self) -> RustealResult<UClassHandle>
pub fn get_class(&self) -> RustealResult<UClassHandle>
Get the object’s UClass handle.
Sourcepub fn get_outer(&self) -> RustealResult<UObjectHandle>
pub fn get_outer(&self) -> RustealResult<UObjectHandle>
Get the object’s Outer.
Source§impl<T: HasParent> UObjectRef<T>
impl<T: HasParent> UObjectRef<T>
Sourcepub fn upcast(self) -> UObjectRef<T::Parent>
pub fn upcast(self) -> UObjectRef<T::Parent>
Infallible upcast to the parent class. Zero-cost (same handle).
Source§impl<T: UeClass> UObjectRef<T>
impl<T: UeClass> UObjectRef<T>
Sourcepub fn upcast_to<U: UeClass>(self) -> UObjectRef<U>where
T: Inherits<U>,
pub fn upcast_to<U: UeClass>(self) -> UObjectRef<U>where
T: Inherits<U>,
Infallible upcast to any ancestor class, checked at compile time
(character.upcast_to::<Object>() for a world context). Zero-cost.
Trait Implementations§
Source§impl<T: UeClass> Clone for UObjectRef<T>
impl<T: UeClass> Clone for UObjectRef<T>
Source§impl<T: UeClass> ContainerElement for UObjectRef<T>
impl<T: UeClass> ContainerElement for UObjectRef<T>
Source§const BUF_SIZE: u32
const BUF_SIZE: u32
Source§unsafe fn read_from_buf(buf: *const u8, _written: u32) -> Self
unsafe fn read_from_buf(buf: *const u8, _written: u32) -> Self
Source§unsafe fn write_to_buf(&self, buf: *mut u8) -> u32
unsafe fn write_to_buf(&self, buf: *mut u8) -> u32
WriteElement to consume.
Returns the number of bytes written. Read moreSource§const RAW_COPYABLE: bool = false
const RAW_COPYABLE: bool = false
impl<T: UeClass> Copy for UObjectRef<T>
Source§impl<T: UeClass> Debug for UObjectRef<T>
impl<T: UeClass> Debug for UObjectRef<T>
Source§impl<T: HasParent> Deref for UObjectRef<T>
Blanket Deref: UObjectRef<Child> auto-derefs to UObjectRef<Parent>.
Safe because UObjectRef<T> is #[repr(transparent)] over UObjectHandle.
impl<T: HasParent> Deref for UObjectRef<T>
Blanket Deref: UObjectRef<Child> auto-derefs to UObjectRef<Parent>.
Safe because UObjectRef<T> is #[repr(transparent)] over UObjectHandle.
impl<T: UeClass> Eq for UObjectRef<T>
Source§impl<T: UeClass> Hash for UObjectRef<T>
impl<T: UeClass> Hash for UObjectRef<T>
Source§impl<T: UeClass> ObjectPointer for UObjectRef<T>
impl<T: UeClass> ObjectPointer for UObjectRef<T>
Source§unsafe fn from_object_handle(handle: UObjectHandle) -> Self
unsafe fn from_object_handle(handle: UObjectHandle) -> Self
Source§fn object_handle(&self) -> UObjectHandle
fn object_handle(&self) -> UObjectHandle
Source§impl<T: UeClass> PartialEq for UObjectRef<T>
impl<T: UeClass> PartialEq for UObjectRef<T>
impl<T: UeClass> Send for UObjectRef<T>
Source§impl<T: UeClass> UeHandle for UObjectRef<T>
impl<T: UeClass> UeHandle for UObjectRef<T>
Source§fn checked_handle(&self) -> RustealResult<UObjectHandle>
fn checked_handle(&self) -> RustealResult<UObjectHandle>
Err(ObjectDestroyed).