You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current implementation of the binding is restricted to handling Enum components where each field is mandated to be 4 bytes in size. This contrasts with Rust's default behavior, which allocates 1 byte per field. Moreover, Rust Enums are capable of accommodating fields of any size, including complex data structures akin to C++'s std::variant.
To extend our support to encompass fully-featured Rust Enums, modifications are necessitated within the C core of Flecs. Preliminary investigations suggest that these adjustments are feasible.
The existing approach to facilitate the compatibility of enum components entails annotating them with Repr(C), ensuring that each field occupies 4 bytes.
The text was updated successfully, but these errors were encountered:
Indra-db
changed the title
Support arbitrary sized Rust enums as components. Currently Flecs only allows 4 byte sized Enums.
Support arbitrary sized Rust enums as components. Currently Flecs only allows 4 byte sized Enum fields.
Mar 7, 2024
Indra-db
changed the title
Support arbitrary sized Rust enums as components. Currently Flecs only allows 4 byte sized Enum fields.
Enhancing Support for Rust Enums with Variable Field Sizes in Flecs C Core
Mar 7, 2024
The current implementation of the binding is restricted to handling Enum components where each field is mandated to be 4 bytes in size. This contrasts with Rust's default behavior, which allocates 1 byte per field. Moreover, Rust Enums are capable of accommodating fields of any size, including complex data structures akin to C++'s std::variant.
To extend our support to encompass fully-featured Rust Enums, modifications are necessitated within the C core of Flecs. Preliminary investigations suggest that these adjustments are feasible.
The existing approach to facilitate the compatibility of enum components entails annotating them with
Repr(C)
, ensuring that each field occupies 4 bytes.The text was updated successfully, but these errors were encountered: