pub struct OwnedStruct<T>where
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> OwnedStruct<T>where
T: UeStruct,
impl<T> OwnedStruct<T>where
T: UeStruct,
Sourcepub fn new() -> OwnedStruct<T>
pub fn new() -> OwnedStruct<T>
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>) -> OwnedStruct<T>
pub fn from_bytes(data: Vec<u8>) -> OwnedStruct<T>
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 copy_from(src: &UStructRef<T>) -> OwnedStruct<T>
pub fn copy_from(src: &UStructRef<T>) -> OwnedStruct<T>
A copy of the struct src points to, made with the struct’s own copy
semantics (deep for strings, arrays and the like).
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> Clone for OwnedStruct<T>where
T: UeStruct,
impl<T> Clone for OwnedStruct<T>where
T: UeStruct,
Source§fn clone(&self) -> OwnedStruct<T>
fn clone(&self) -> OwnedStruct<T>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<T> ContainerElement for OwnedStruct<T>where
T: UeStruct,
impl<T> ContainerElement for OwnedStruct<T>where
T: UeStruct,
Source§const BUF_SIZE: u32 = 4096
const BUF_SIZE: u32 = 4096
Source§unsafe fn read_from_buf(buf: *const u8, written: u32) -> OwnedStruct<T>
unsafe fn read_from_buf(buf: *const u8, written: u32) -> OwnedStruct<T>
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