pub struct UObjectRef<T>where
T: UeClass,{ /* private fields */ }Expand description
Implementations§
Source§impl<T> UObjectRef<T>where
T: UeClass,
impl<T> UObjectRef<T>where
T: UeClass,
Sourcepub unsafe fn from_raw(handle: UObjectHandle) -> UObjectRef<T>
pub unsafe fn from_raw(handle: UObjectHandle) -> UObjectRef<T>
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) -> Result<Checked<T>, RustealError>
pub fn checked(&self) -> Result<Checked<T>, RustealError>
Validate that the object is still alive, returning a Checked<T>
handle that provides infallible access to extension trait methods.
Sourcepub fn cast<U>(self) -> Result<UObjectRef<U>, RustealError>where
U: UeClass,
pub fn cast<U>(self) -> Result<UObjectRef<U>, RustealError>where
U: UeClass,
Cast to a different UClass type. Fails if the object is destroyed
or is not an instance of U.
Sourcepub fn pin(self) -> Result<Pinned<T>, RustealError>
pub fn pin(self) -> Result<Pinned<T>, RustealError>
Upgrade to a Pinned<T>, adding a GC root to keep the object alive.
Sourcepub fn get_name(&self) -> Result<String, RustealError>
pub fn get_name(&self) -> Result<String, RustealError>
Get the object’s FName as a String.
Sourcepub fn get_class(&self) -> Result<UClassHandle, RustealError>
pub fn get_class(&self) -> Result<UClassHandle, RustealError>
Get the object’s UClass handle.
Sourcepub fn get_outer(&self) -> Result<UObjectHandle, RustealError>
pub fn get_outer(&self) -> Result<UObjectHandle, RustealError>
Get the object’s Outer.
Source§impl<T> UObjectRef<T>where
T: HasParent,
impl<T> UObjectRef<T>where
T: HasParent,
Sourcepub fn upcast(self) -> UObjectRef<<T as HasParent>::Parent>
pub fn upcast(self) -> UObjectRef<<T as HasParent>::Parent>
Infallible upcast to the parent class. Zero-cost (same handle).
Trait Implementations§
Source§impl<T> Clone for UObjectRef<T>
impl<T> 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 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<T> ContainerElement for UObjectRef<T>where
T: UeClass,
impl<T> ContainerElement for UObjectRef<T>where
T: UeClass,
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) -> UObjectRef<T>
unsafe fn read_from_buf(buf: *const u8, _written: u32) -> UObjectRef<T>
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.
impl<T> Copy for UObjectRef<T>
Source§impl<T> Debug for UObjectRef<T>where
T: UeClass,
impl<T> Debug for UObjectRef<T>where
T: UeClass,
Source§impl<T> Deref for UObjectRef<T>where
T: HasParent,
Blanket Deref: UObjectRef<Child> auto-derefs to UObjectRef<Parent>.
Safe because UObjectRef<T> is #[repr(transparent)] over UObjectHandle.
impl<T> Deref for UObjectRef<T>where
T: HasParent,
Blanket Deref: UObjectRef<Child> auto-derefs to UObjectRef<Parent>.
Safe because UObjectRef<T> is #[repr(transparent)] over UObjectHandle.
impl<T> Eq for UObjectRef<T>
Source§impl<T> Hash for UObjectRef<T>
impl<T> Hash for UObjectRef<T>
Source§impl<T> ObjectPointer for UObjectRef<T>where
T: UeClass,
impl<T> ObjectPointer for UObjectRef<T>where
T: UeClass,
Source§unsafe fn from_object_handle(handle: UObjectHandle) -> UObjectRef<T>
unsafe fn from_object_handle(handle: UObjectHandle) -> UObjectRef<T>
Wrap a pointer the engine returned. Read more
Source§fn object_handle(&self) -> UObjectHandle
fn object_handle(&self) -> UObjectHandle
The pointer to hand to the engine.
Source§impl<T> PartialEq for UObjectRef<T>
impl<T> PartialEq for UObjectRef<T>
impl<T> Send for UObjectRef<T>where
T: UeClass,
impl<T> StructuralPartialEq for UObjectRef<T>
Source§impl<T> UeHandle for UObjectRef<T>where
T: UeClass,
impl<T> UeHandle for UObjectRef<T>where
T: UeClass,
Source§fn checked_handle(&self) -> Result<UObjectHandle, RustealError>
fn checked_handle(&self) -> Result<UObjectHandle, RustealError>
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.
Auto Trait Implementations§
impl<T> !Sync for UObjectRef<T>
impl<T> Freeze for UObjectRef<T>
impl<T> RefUnwindSafe for UObjectRef<T>
impl<T> Unpin for UObjectRef<T>
impl<T> UnsafeUnpin for UObjectRef<T>
impl<T> UnwindSafe for UObjectRef<T>
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