pub struct OwnedStruct<T: UeStruct> { /* private fields */ }Expand description
An owned copy of UE struct data retrieved from a container.
Since UE structs are opaque (their layout is managed by C++), this type
holds the raw bytes copied from the container. Use as_ref
to get a UStructRef<T> for property access.
Implementations§
Source§impl<T: UeStruct> OwnedStruct<T>
impl<T: UeStruct> OwnedStruct<T>
Sourcepub fn new() -> Self
pub fn new() -> Self
Allocate a new struct initialized via C++ default constructor.
Uses the UE reflection system to determine the struct’s size,
allocates a zero-filled buffer, then calls UScriptStruct::InitializeStruct
to properly construct non-trivial members (TArray, FString, etc.).
The struct is destroyed via UScriptStruct::DestroyStruct on drop.
Sourcepub fn from_bytes(data: Vec<u8>) -> Self
pub fn from_bytes(data: Vec<u8>) -> Self
Create from raw bytes (e.g., copied from a container element).
The data is assumed to already be initialized by C++ — no destructor will be called on drop.
Sourcepub fn as_ref(&self) -> UStructRef<T>
pub fn as_ref(&self) -> UStructRef<T>
Get a UStructRef<T> for property access on this struct data.
Trait Implementations§
Source§impl<T: UeStruct> Clone for OwnedStruct<T>
impl<T: UeStruct> Clone for OwnedStruct<T>
Source§impl<T: UeStruct> ContainerElement for OwnedStruct<T>
impl<T: UeStruct> ContainerElement for OwnedStruct<T>
Source§const BUF_SIZE: u32 = 4096
const BUF_SIZE: u32 = 4096
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 more