pub unsafe trait ContainerElement: Sized {
const BUF_SIZE: u32;
const RAW_COPYABLE: bool = false;
// Required methods
unsafe fn read_from_buf(buf: *const u8, written: u32) -> Self;
unsafe fn write_to_buf(&self, buf: *mut u8) -> u32;
}Expand description
Trait for types that can be stored in UE containers.
§Safety
BUF_SIZE must match what the C++ side expects for this element type.
read_from_buf must correctly interpret the bytes written by C++’s
ReadElement, and write_to_buf must produce bytes that C++’s
WriteElement can interpret.
Required Associated Constants§
Provided Associated Constants§
Sourceconst 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.
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.