Skip to main content

ustruct

Attribute Macro ustruct 

Source
#[ustruct]
Expand description

Attribute macro for defining a Rust struct as a UE struct: a data table’s row, a property’s value. Every field is a #[uproperty]; the struct’s memory is UE’s, read and written through the generated <Name>Ext trait on UStructRef<Name> and OwnedStruct<Name>.

§Example

ⓘ
#[ustruct]
pub struct WeaponTableRow {
    #[uproperty(EditAnywhere)]
    static_mesh: SoftObjectRef<StaticMesh>,
    #[uproperty(EditAnywhere)]
    weapon_to_spawn: SubclassOf<ShooterWeapon>,
}