I\'m looking for the right method to statically register structures at compile time.
The origin of this requirement is to have a bunch of applets with dedic
This is not a direct answer to your question but just FYI... For ELF binaries, I could achieve something similar to GCC's __attribute__((constructor)) with
fn init() { ... }
#[link_section = ".init_array"]
static INIT: fn() = init;
This is obviously a deviation from Rust's design philosophies. (Portability and what @DK calls "no code before main" principle.)
INIT can also be an Rust array. You might need to pay more attention to alignments.