link-section 0.17.1

Link-time initialized slices for Rust, with full support for Linux, macOS, Windows, WASM and many more platforms.
Documentation
use link_section::declarative::{section, in_section};
use link_section::TypedSection;

struct Driver {
    name: &'static str,
    f: fn(),
}

impl Driver {
    const fn new(name: &'static str, f: fn()) -> Self {
        Self { name, f }
    }
}

section! {
    #[section(typed)]
    static FOO: TypedSection<Driver>;
}

in_section! {
    #[in_section(FOO)]
    const DRIVER: Driver = Driver::new("driver", || ());
}

fn main() {
}